/* ==========================================================================
   Vault (RFile) - Modern Production UI Stylesheet
   ========================================================================== */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-light: #eff6ff;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 10px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--primary-hover);
}

/* Header & Navigation */
.navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-main);
    text-decoration: none;
}

.brand-badge {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-weight: 600;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Main Container */
.main-wrapper {
    flex: 1;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Alert Flashes */
.alert-container {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 500;
    font-size: 0.925rem;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    line-height: 1.25;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    color: #ffffff;
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover:not(:disabled) {
    background: var(--danger-hover);
}

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.825rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.05rem;
}

/* Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: #334155;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    color: var(--text-main);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Drag & Drop Zone */
.dropzone {
    border: 2px dashed #93c5fd;
    background: #f8fafc;
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.dropzone-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.dropzone-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
}

.dropzone-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* File Queue & Upload Progress */
.file-queue {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.queue-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    box-shadow: var(--shadow-sm);
}

.queue-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.queue-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    word-break: break-all;
}

.queue-item-size {
    font-size: 0.825rem;
    color: var(--text-muted);
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.4rem 0;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.15s linear;
}

.queue-item-status {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Drive Layout */
.drive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    flex-wrap: wrap;
}

.crumb-separator {
    color: var(--text-muted);
}

.drive-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-bar {
    display: flex;
    gap: 0.5rem;
    max-width: 450px;
    width: 100%;
}

/* File Table */
.data-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.925rem;
}

.data-table th {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.data-table tr:hover td {
    background: #f8fafc;
}

.node-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    vertical-align: middle;
    color: #64748b;
}

.node-icon.folder {
    color: #eab308;
}

/* Quota Bar */
.quota-widget {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}

.quota-bar-wrapper {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin: 0.35rem 0;
    overflow: hidden;
}

.quota-bar {
    height: 100%;
    background: var(--primary);
}

.quota-bar.danger {
    background: var(--danger);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(2px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    background: #ffffff;
    padding: 1.25rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: auto;
}

/* Component Styles for Transfers & Shares */
.guest-container {
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
}

.guest-hero {
    text-align: center;
    margin-bottom: 2rem;
}

.guest-hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.guest-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.label-optional {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.drop-options-form {
    margin-top: 2rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.security-accordion {
    margin-top: 1rem;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
}

.security-accordion summary {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    user-select: none;
}

.retention-info-badge {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.875rem 1rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #475569;
}

.form-submit-row {
    text-align: right;
}

.submit-btn {
    min-width: 240px;
    font-weight: 700;
    justify-content: center;
}

/* Instant Share Card */
.share-card {
    border: 2px solid var(--success);
    background: #f0fdf4;
    margin-bottom: 2rem;
    padding: 2rem;
}

.share-card-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.success-icon-badge {
    width: 46px;
    height: 46px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #059669;
    flex-shrink: 0;
}

.share-card-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #065f46;
    margin: 0;
}

.share-card-header p {
    font-size: 0.875rem;
    color: #047857;
    margin: 0;
}

.share-link-group {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.share-input {
    font-size: 1.05rem;
    font-weight: 600;
    background: #ffffff;
    border: 2px solid var(--success);
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.share-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.share-btn {
    min-width: 130px;
    white-space: nowrap;
    justify-content: center;
}

.copy-toast {
    font-size: 0.9rem;
    font-weight: 600;
    color: #059669;
    margin-bottom: 1rem;
}

.recipient-notice-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    color: #065f46;
    margin-bottom: 1rem;
}

.secret-accordion {
    margin-top: 1rem;
    background: #ffffff;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
}

.secret-accordion summary {
    font-size: 0.85rem;
    font-weight: 600;
    color: #065f46;
    cursor: pointer;
    user-select: none;
}

.secret-content {
    margin-top: 0.75rem;
    display: flex;
    gap: 0.5rem;
}

.share-card-footer {
    margin-top: 1.5rem;
    text-align: center;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.pulse-animation {
    animation: pulse 1.8s infinite;
}

/* ==========================================================================
   Mobile Optimization (Responsive Breakpoints)
   ========================================================================== */

@media (max-width: 768px) {
    .navbar {
        padding: 0.65rem 1rem;
    }

    .nav-container {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .brand {
        justify-content: center;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4rem;
        font-size: 0.85rem;
    }

    .nav-link {
        padding: 0.35rem 0.6rem;
    }

    .main-wrapper {
        padding: 1rem 0.75rem;
    }

    .guest-hero h1 {
        font-size: 1.75rem;
    }

    .guest-hero p {
        font-size: 0.95rem;
    }

    .card {
        padding: 1.25rem 1rem;
    }

    .share-card {
        padding: 1.25rem 1rem;
    }

    /* Prevent iOS auto-zoom by ensuring 16px font */
    .form-control {
        font-size: 16px;
        min-height: 44px;
    }

    /* Accessible 44px touch targets on mobile */
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 38px;
    }

    .drive-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .drive-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .search-bar {
        max-width: 100%;
        width: 100%;
    }

    .modal-content {
        padding: 1.25rem 1rem;
        width: 95%;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .share-link-group {
        flex-direction: column;
    }

    .share-actions {
        width: 100%;
    }

    .share-actions .btn {
        flex: 1;
        width: 100%;
    }

    .secret-content {
        flex-direction: column;
    }

    .form-submit-row {
        text-align: stretch;
    }

    .submit-btn {
        width: 100%;
        min-width: 100%;
    }

    .dropzone {
        padding: 1.75rem 1rem;
    }

    .dropzone-title {
        font-size: 1rem;
    }

    .dropzone-desc {
        font-size: 0.8rem;
    }

    .queue-item {
        padding: 0.75rem 0.85rem;
    }

    .queue-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}


