/* Reset và Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Navigation */
.nav {
    background: #f8f9fa;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

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

.nav .nav-links span {
    margin-right: 15px;
    color: #333;
}

.nav-links a {
    color: #ff6b9d;
    text-decoration: none;
    margin-left: 20px;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    background: #ff6b9d;
    color: white;
}

/* Main Content */
.main-content {
    padding: 40px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #ff6b9d;
    border-radius: 20px;
    padding: 60px 20px;
    text-align: center;
    background: #fff5f8;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 30px;
}

.upload-area.dragover {
    background: #ffeef5;
    border-color: #ff6b9d;
    transform: scale(1.02);
}

.upload-area i {
    font-size: 4em;
    color: #ff6b9d;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
}

.upload-limit {
    background: rgba(255, 107, 157, 0.1);
    color: #c44569 !important;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 157, 0.3);
    font-weight: bold;
    font-size: 13px !important;
}

.file-input {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
    margin-top: 10px;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(255, 107, 157, 0.4);
}

.upload-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.3);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin: 20px 0;
    overflow: hidden;
    display: none;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* File List */
.file-list {
    margin-top: 30px;
}

.file-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.file-size {
    color: #666;
    font-size: 0.9em;
}

.file-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #ff6b9d;
    color: white;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

        .btn-danger {
            background: #dc3545;
            color: white;
        }

        .btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-secondary {
    background: #007bff;
    color: white;
}

        .btn-danger {
            background: #dc3545;
            color: white;
        }

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

/* Alerts */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Forms */
.login-form, .register-form {
    max-width: 400px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1em;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.form-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 107, 157, 0.3);
}

.form-links {
    text-align: center;
}

.form-links a {
    color: #ff6b9d;
    text-decoration: none;
    margin: 0 10px;
}

.form-links a:hover {
    text-decoration: underline;
}

.password-requirements {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

/* Back Link */
.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-size: 1.1em;
    padding: 10px 20px;
    border-radius: 25px;
    background: rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.back-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* Admin Specific */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
}

.stat-card i {
    font-size: 3em;
    margin-bottom: 15px;
}

.stat-card h3 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-card p {
    opacity: 0.9;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.table-container {
    background: #f8f9fa;
    border-radius: 15px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

th {
    background: #ff6b9d;
    color: white;
    font-weight: bold;
}

tr:hover {
    background: #e9ecef;
}

.tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.tab {
    padding: 15px 30px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab.active {
    border-bottom-color: #ff6b9d;
    color: #ff6b9d;
    font-weight: bold;
}

.tab:hover {
    background: #f8f9fa;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 15px;
    }

    .header h1 {
        font-size: 2em;
    }

    .header p {
        font-size: 1em;
    }

    .nav {
        padding: 10px 20px;
        flex-direction: column;
        gap: 10px;
    }

    .nav > div {
        width: 100%;
        text-align: center;
    }

    .nav-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-links a {
        margin: 5px;
        font-size: 0.9em;
    }

    .main-content {
        padding: 20px;
    }

    .upload-area {
        padding: 40px 15px;
    }

    .upload-area h3 {
        font-size: 1.2em;
    }

    .upload-area i {
        font-size: 3em;
    }

    .file-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .file-info {
        text-align: center;
    }

    .file-actions {
        justify-content: center;
    }

    .btn {
        padding: 10px 15px;
        font-size: 0.85em;
    }

    .login-form, .register-form {
        margin: 20px;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-card i {
        font-size: 2.5em;
    }

    .stat-card h3 {
        font-size: 2em;
    }

    .tabs {
        flex-direction: column;
    }
    
    .download-btn {
        min-width: 200px;
        width: 100%;
        max-width: 100%;
        font-size: 16px;
        height: 40px;
        line-height: 40px;
        margin: 0 auto 8px auto;
        box-sizing: border-box;
        position: relative;
        display: inline-flex;
        align-items: center;
    }
    
    .download-btn span,
    .download-btn a {
        font-size: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        vertical-align: middle;
        height: 100%;
        position: absolute;
        left: 50px;
        top: 0;
        right: 0;
        padding: 0 15px;
        transform: translateX(0);
        box-sizing: border-box;
    }
    
    .download-btn::after {
        left: 2px;
        top: -1px;
        width: 40px;
        height: 40px;
        background-size: 36px;
    }

    .tab {
        padding: 12px 20px;
        text-align: center;
    }

    .table-container {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }

    th, td {
        padding: 10px 8px;
        font-size: 0.9em;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5em;
    }

    .upload-area {
        padding: 30px 10px;
    }

    .upload-area h3 {
        font-size: 1.1em;
    }

    .file-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn {
        width: 100%;
        margin: 2px 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card h3 {
        font-size: 1.8em;
    }

    .section h2 {
        font-size: 1.5em;
    }

    .btn {
        width: 100%;
        margin: 2px 0;
        text-align: center;
    }

            .file-actions {
            flex-direction: column;
            gap: 5px;
        }
    }

    /* Download Button Styles - Apple Style with Java Icon */
    .download-btn {
        min-width: 245px;
        width: auto;
        max-width: 100%;
        border-radius: 2px;
        font-size: 20px;
        position: relative;
        line-height: 40px;
        display: inline-flex;
        margin: 0 auto 8px auto;
        font-weight: bold;
        vertical-align: bottom;
        height: 40px;
        color: #fff;
        background: #1faa00;
        align-items: center;
        box-sizing: border-box;
    }

    .download-btn::after {
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" fill="white"><path d="M405.8 376.9C415.6 370.2 429.2 364.4 429.2 364.4C429.2 364.4 390.5 371.4 352 374.6C304.9 378.5 254.3 379.3 228.9 375.9C168.8 367.9 261.9 345.8 261.9 345.8C261.9 345.8 225.8 343.4 181.3 364.8C128.8 390.2 311.3 401.8 405.8 376.9zM320.4 344.8C301.4 302.1 237.3 264.6 320.4 199C424.1 117.2 370.9 64 370.9 64C392.4 148.5 295.3 174.1 260.2 226.6C236.3 262.5 271.9 301 320.4 344.8zM435 168.6C435.1 168.6 259.8 212.4 343.5 308.8C368.2 337.2 337 362.8 337 362.8C337 362.8 399.7 330.4 370.9 289.9C344 252.1 323.4 233.3 435 168.6zM428.9 439.1C428.4 440.1 427.7 440.9 426.9 441.7C555.2 408 508 322.8 446.7 344.4C443.4 345.6 440.5 347.8 438.5 350.7C442.1 349.4 445.8 348.4 449.5 347.7C480.5 341.2 525 389.2 428.9 439.1zM476 501.4C476 501.4 490.5 513.3 460.1 522.6C402.2 540.1 219.3 545.4 168.5 523.3C150.2 515.4 184.5 504.3 195.3 502C206.5 499.6 213 500 213 500C192.7 485.7 81.7 528.1 156.6 540.2C360.8 573.4 529 525.3 476 501.4zM252.5 460C173.8 482 300.4 527.4 400.6 484.5C390.8 480.7 381.4 476.1 372.4 470.7C327.7 479.2 307 479.8 266.4 475.2C232.9 471.4 252.5 460 252.5 460zM432.3 557.2C353.6 572 256.5 570.3 199 560.8C199 560.7 210.8 570.5 271.4 574.4C363.6 580.3 505.2 571.1 508.5 527.5C508.5 527.5 502.1 544 432.3 557.2zM388.7 417C329.5 428.4 295.2 428.1 251.9 423.6C218.4 420.1 240.3 403.9 240.3 403.9C153.5 432.7 288.5 465.3 409.8 429.8C402 427 394.8 422.7 388.7 417z"/></svg>') center center no-repeat;
        width: 40px;
        height: 40px;
        background-size: 38px;
        position: absolute;
        left: 2px;
        top: -1px;
        content: "";
        border-right: 1px solid #ffffff9b;
        z-index: 1;
    }
    
    .download-btn a {
        color: #fff;
        text-decoration: none;
        display: block;
        width: 100%;
        height: 100%;
        text-align: center;
    }
    
    .download-btn span,
.download-btn a {
    margin: 0;
    font-size: 18px;
    font-weight: normal;
    line-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    vertical-align: middle;
    padding-left: 50px;
    padding-right: 15px;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

    .download-btn:hover {
        background: #30D158; /* Lighter green on hover */
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(52, 199, 89, 0.4);
        color: white !important;
        text-decoration: none;
    }

    .download-btn:active {
        transform: translateY(0);
        background: #28A745; /* Darker green when pressed */
        box-shadow: 0 2px 4px rgba(52, 199, 89, 0.3);
    }

    /* Upload Success Animation */
    .upload-success {
        animation: slideInRight 0.5s ease-out;
        border-left: 4px solid #28a745;
        background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    }

    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    .upload-success .file-name::after {
        content: ' ✓';
        color: #28a745;
        font-weight: bold;
        animation: fadeIn 0.5s ease-in 0.3s both;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }

    /* Multiple File Upload Progress */
    .upload-progress {
        background: #f8f9fa;
        border-radius: 10px;
        padding: 15px;
        margin: 10px 0;
        border: 1px solid #e9ecef;
    }

    .upload-summary {
        margin-bottom: 15px;
        padding: 12px;
        background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
        border-radius: 8px;
        color: white;
    }

    .upload-info {
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: bold;
        font-size: 14px;
    }

    .upload-count {
        background: rgba(255,255,255,0.2);
        padding: 4px 8px;
        border-radius: 15px;
        font-size: 12px;
        font-weight: bold;
    }

    .upload-progress h4 {
        margin: 0 0 10px 0;
        color: #333;
        font-size: 14px;
    }

    .upload-progress .progress-item {
        display: flex;
        align-items: center;
        margin-bottom: 8px;
        padding: 8px;
        background: white;
        border-radius: 8px;
        border: 1px solid #e9ecef;
    }

    .upload-progress .progress-item:last-child {
        margin-bottom: 0;
    }

    .upload-progress .file-name {
        flex: 1;
        font-size: 12px;
        color: #666;
        margin-right: 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .upload-progress .progress-status {
        font-size: 12px;
        font-weight: bold;
    }

    .upload-progress .progress-status.success {
        color: #28a745;
    }

    .upload-progress .progress-status.error {
        color: #dc3545;
    }

    .upload-progress .progress-status.uploading {
        color: #ff6b9d;
    }

    /* Notification Styles */
    .notification {
        position: fixed;
        top: 20px;
        right: 20px;
        background: white;
        color: #333;
        padding: 15px 20px;
        border-radius: 10px;
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
        z-index: 10000;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        max-width: 300px;
        border-left: 4px solid #ff6b9d;
    }

    .notification.show {
        transform: translateX(0);
    }

    .notification-success {
        border-left-color: #28a745;
        background: linear-gradient(135deg, #f8fff9 0%, #e8f5e8 100%);
    }

    .notification-error {
        border-left-color: #dc3545;
        background: linear-gradient(135deg, #fff8f8 0%, #ffe8e8 100%);
    }

    .notification i {
        margin-right: 8px;
        color: #ff6b9d;
    }

    .notification-success i {
        color: #28a745;
    }

    .notification-error i {
        color: #dc3545;
    }

    /* Animation cho xóa file */
    @keyframes fadeOut {
        from {
            opacity: 1;
            transform: translateX(0);
        }
        to {
            opacity: 0;
            transform: translateX(-100%);
        }
    }
