/* ========================================
   FolderBeam Modern UI - Google-Inspired
   Clean, Professional, No Gaps - Complete Version
   ======================================== */

/* ---------- CSS Variables (Theme) ---------- */
:root {
    /* Primary Colors - Google Inspired */
    --primary: #1a73e8;
    --primary-dark: #0d47a1;
    --primary-light: #e8f0fe;
    --accent: #34a853;
    --accent-dark: #0f9d58;
    --warning: #fbbc04;
    --danger: #ea4335;
    
    /* Neutral Colors */
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-light: #dadce0;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-disabled: #9aa0a6;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
    --shadow-md: 0 1px 3px 0 rgba(60,64,67,0.3), 0 4px 8px 3px rgba(60,64,67,0.15);
    --shadow-lg: 0 2px 6px 2px rgba(60,64,67,0.15), 0 1px 2px 0 rgba(60,64,67,0.3);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 20px;
    --space-2xl: 24px;
    --space-3xl: 32px;
}

/* ---------- Global Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: var(--bg-white);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    display: flex;
    flex-direction: column;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 3rem; font-weight: 700; letter-spacing: -0.5px; }
h2 { font-size: 2.5rem; font-weight: 600; letter-spacing: -0.5px; }
h3 { font-size: 1.75rem; font-weight: 600; }
h4 { font-size: 1.5rem; font-weight: 600; }
h5 { font-size: 1.25rem; font-weight: 600; }
h6 { font-size: 1rem; font-weight: 600; }

p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ---------- Container ---------- */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-3xl);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-xl);
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* ---------- Main Content ---------- */
main {
    flex: 1;
    min-height: calc(100vh - 72px - 400px);
}

/* ---------- Cards - Material Design ---------- */
.card {
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-xl);
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-xl) var(--space-2xl);
    font-weight: 600;
    font-size: 1.1rem;
}

.card-body {
    padding: var(--space-2xl);
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-light);
    padding: var(--space-lg) var(--space-2xl);
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    padding: 0 var(--space-xl);
    height: 40px;
    line-height: 40px;
    text-transform: none;
    letter-spacing: 0.25px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
    margin: 0;
    box-shadow: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    background: var(--accent-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}

.btn-lg {
    height: 48px;
    line-height: 48px;
    padding: 0 var(--space-2xl);
    font-size: 16px;
}

.btn-sm {
    height: 32px;
    line-height: 32px;
    padding: 0 var(--space-lg);
    font-size: 13px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: var(--space-xl);
}

.form-label {
    display: block;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.form-control {
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: var(--space-md) var(--space-lg);
    font-size: 14px;
    width: 100%;
    transition: all 0.2s;
    background: var(--bg-white);
    height: 44px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,115,232,0.1);
}

textarea.form-control {
    height: auto;
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    height: 44px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-lg) center;
    padding-right: var(--space-3xl);
}

/* ---------- Tables ---------- */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-light);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

.table td {
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.table tbody tr:hover {
    background: var(--bg-light);
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: 12px;
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-xl);
    border: none;
    border-left: 4px solid transparent;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    border-left-color: var(--accent);
}

.alert-danger {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
    border-left-color: var(--danger);
}

.alert-info {
    background: linear-gradient(135deg, #e3f2fd, #bbdef5);
    color: #1565c0;
    border-left-color: var(--primary);
}

.alert-warning {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #ef6c00;
    border-left-color: var(--warning);
}

/* ---------- Modals ---------- */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: var(--space-xl) var(--space-2xl);
    border-bottom: 1px solid var(--border-light);
}

.modal-body {
    padding: var(--space-2xl);
}

.modal-footer {
    padding: var(--space-lg) var(--space-2xl);
    border-top: 1px solid var(--border-light);
}

/* ---------- Progress Bars ---------- */
.progress {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}

/* ---------- Badges ---------- */
.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #e8f5e9; color: var(--accent); }
.badge-danger { background: #ffebee; color: var(--danger); }
.badge-warning { background: #fff3e0; color: #ef6c00; }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    padding: var(--space-lg) 0;
    margin: 0;
    background: transparent;
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item a {
    color: var(--primary);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--border-light);
}

/* ---------- Upload/Download Cards ---------- */
.upload-card, .download-card {
    height: 100%;
}

/* ---------- File/Folder Grid ---------- */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--space-xl);
    margin: var(--space-xl) 0;
}

.folder-item {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: var(--space-xl);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.folder-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.folder-item i {
    font-size: 48px;
    color: var(--primary);
    margin-bottom: var(--space-md);
}

/* ---------- Toast Messages ---------- */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.toast-message {
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-md);
    border-radius: 12px;
    color: white;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-message.success { background: var(--accent); }
.toast-message.error { background: var(--danger); }
.toast-message.info { background: var(--primary); }

.toast-close {
    cursor: pointer;
    font-size: 20px;
    margin-left: var(--space-lg);
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toast-close:hover { opacity: 1; }

/* ---------- Password Modal ---------- */
.download-password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.download-password-modal .modal-content {
    background: white;
    padding: var(--space-2xl);
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ---------- Share Modal ---------- */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.share-modal .modal-content {
    background: white;
    padding: var(--space-2xl);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    animation: scaleIn 0.3s ease;
}

.share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.share-btn {
    padding: var(--space-md);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    transition: all 0.3s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.facebook { background: #1877f2; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.linkedin { background: #0077b5; }
.share-btn.email { background: #ea4335; }

/* ---------- Action Buttons ---------- */
.action-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
    margin: var(--space-xl) 0;
}

.action-btn {
    padding: var(--space-md);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.action-btn i {
    font-size: 20px;
}

.action-btn.view { background: #17a2b8; }
.action-btn.download { background: var(--accent); }
.action-btn.print { background: #6c757d; }
.action-btn.share { background: var(--primary); }

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---------- File Info Display ---------- */
.file-info {
    background: var(--bg-light);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    border-left: 4px solid var(--accent);
    display: none;
}

.file-info.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.file-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: var(--space-sm);
    word-break: break-all;
}

/* ---------- Upload/Download Progress ---------- */
.upload-progress-container,
.download-progress-container {
    margin-top: var(--space-lg);
    display: none;
}

.upload-progress-container .progress,
.download-progress-container .progress {
    height: 40px;
    border-radius: 20px;
    background: var(--bg-light);
}

.upload-progress-container .progress-bar,
.download-progress-container .progress-bar {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    line-height: 40px;
    font-weight: 600;
    transition: width 0.3s ease;
    text-align: center;
    border-radius: 20px;
}

/* ---------- Folder Message ---------- */
.folder-message {
    padding: var(--space-lg);
    border-radius: 12px;
    margin-top: var(--space-lg);
    display: none;
    animation: slideDown 0.3s ease;
}

.folder-message.info {
    background: #e3f2fd;
    border-left: 4px solid var(--primary);
    color: #1565c0;
}

.folder-message.warning {
    background: #fff3e0;
    border-left: 4px solid var(--warning);
    color: #ef6c00;
}

.folder-message.error {
    background: #ffebee;
    border-left: 4px solid var(--danger);
    color: #c62828;
}

.folder-message.success {
    background: #e8f5e9;
    border-left: 4px solid var(--accent);
    color: #2e7d32;
}

/* ---------- Utility Classes ---------- */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-hover {
    transition: all 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-disabled);
}

/* ---------- Responsive Design ---------- */
@media (max-width: 992px) {
    .action-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --space-2xl: 20px;
        --space-3xl: 24px;
    }
    
    .folder-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .share-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}