@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #141e30, #243b55);
    min-height: 100vh;
}

/* Login Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 400px;
}

.login-card h2 {
    margin-bottom: 30px;
    color: #333;
    text-align: center;
}

.login-card input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.login-card button {
    width: 100%;
    padding: 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.login-card button:hover {
    background: #5568d3;
}

.error {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
}

/* Hub Content */
.hub-hidden {
    display: none !important;
}

#hubContent {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    color: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.header h1 {
    font-size: 22px;
    font-weight: 300;
}

.logout-btn {
    padding: 8px 20px;
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(192, 57, 43, 1);
}

/* Container */
.container {
    width: 98%;
    max-width: 100%;
    margin: 10px auto;
    flex: 1;
    padding: 0 10px;
}

.card {
    background: hsl(232deg 18% 8%);
    border-radius: 10px;
    border-top: 1px solid #3b3d3f;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    height: calc(100vh - 90px);
}

/* Tabs System */
.tabs-header {
    position: relative;
    display: flex;
    width: 100%;
}

.tabs .tab-selector {
    display: none;
}

.tabs label.tab {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 10px;
    margin: 0;
    background: hsl(232deg 6% 17%);
    color: #e7e9f5;
    border-top: 1px solid #3b3d3f;
    border-right: 1px solid #2a2c2e;
    text-transform: uppercase;
    font-weight: 400;
    font-size: 10pt;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    white-space: nowrap;
}

.tabs label.tab:first-of-type {
    border-radius: 10px 0 0 0;
}

.tabs label.tab:last-of-type {
    border-radius: 0 10px 0 0;
    border-right: none;
}

.tabs label.tab:hover {
    background: hsl(232deg 8% 20%);
}

/* Active tab colors */
#tab-1:checked ~ .tabs-header label[for="tab-1"] {
    color: #64b5f6;
}

#tab-2:checked ~ .tabs-header label[for="tab-2"] {
    color: #4caf50;
}

#tab-3:checked ~ .tabs-header label[for="tab-3"] {
    color: #ff77d4;
}

#tab-4:checked ~ .tabs-header label[for="tab-4"] {
    color: #ffa726;
}

/* Glider */
.glider {
    width: 25%;
    height: 4px;
    border-radius: 2px 2px 0 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#tab-1:checked ~ .tabs-header .glider {
    left: 0%;
    background: linear-gradient(90deg, #42a5f5 0%, #478ed1 50%, #5c6bc0 100%);
    box-shadow: 0px 0px 12px 0px rgba(100, 181, 246, 0.7);
}

#tab-2:checked ~ .tabs-header .glider {
    left: 25%;
    background: linear-gradient(90deg, #66bb6a 0%, #4caf50 50%, #43a047 100%);
    box-shadow: 0px 0px 12px 0px rgba(76, 175, 80, 0.7);
}

#tab-3:checked ~ .tabs-header .glider {
    left: 50%;
    background: linear-gradient(90deg, #ff77d4 0%, #e040fb 50%, #d500f9 100%);
    box-shadow: 0px 0px 12px 0px rgba(255, 119, 212, 0.7);
}

#tab-4:checked ~ .tabs-header .glider {
    left: 75%;
    background: linear-gradient(90deg, #ffa726 0%, #ff9800 50%, #fb8c00 100%);
    box-shadow: 0px 0px 12px 0px rgba(255, 167, 38, 0.7);
}

/* Content */
.content {
    position: relative;
    background: hsl(232deg 16% 12%);
    border-top: 1px solid #3b3d3f;
    height: calc(100% - 50px);
    min-height: auto;
}

.content .item {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s, visibility 0.3s;
    overflow: auto;
}

#tab-1:checked ~ .content #content-1,
#tab-2:checked ~ .content #content-2,
#tab-3:checked ~ .content #content-3,
#tab-4:checked ~ .content #content-4 {
    opacity: 1;
    visibility: visible;
}

/* Split view for survey + upload */
.split-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.survey-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    z-index: 10;
}

.survey-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 900px;
}

.survey-btn {
    flex: 1;
    min-width: 250px;
    padding: 40px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 24px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.survey-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

.survey-btn:active {
    transform: translateY(-2px);
}

.survey-frame {
    flex: 1;
    overflow: hidden;
}

.survey-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Survey Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: hsl(232deg 18% 8%);
    margin: 2% auto;
    width: 95%;
    height: 95%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: hsl(232deg 14% 10%);
    border-bottom: 2px solid #3b3d3f;
}

.modal-header h2 {
    color: #64b5f6;
    font-size: 24px;
    font-weight: 500;
    margin: 0;
}

.close-modal {
    color: #e7e9f5;
    font-size: 35px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-modal:hover {
    color: #ff6b6b;
}

.modal-body {
    flex: 1;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 0;
    background: hsl(232deg 14% 10%);
    padding: 10px 20px;
    border-bottom: 2px solid #3b3d3f;
}

.category-tab {
    flex: 1;
    padding: 12px 20px;
    background: hsl(232deg 10% 15%);
    color: #e7e9f5;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
    margin-right: 5px;
}

.category-tab:hover {
    background: hsl(232deg 12% 18%);
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.category-content {
    flex: 1;
    position: relative;
    overflow: hidden;
    height: calc(100% - 65px);
}

.category-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.category-frame.active {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.upload-section {
    background: hsl(232deg 14% 10%);
    border-top: 2px solid #3b3d3f;
    padding: 5px;
    position: relative;
    z-index: 10;
}

.upload-section select {
    padding: 10px;
    border: 1px solid #667eea;
    border-radius: 5px;
    background: hsl(232deg 18% 8%);
    color: #e7e9f5;
    font-size: 14px;
    flex: 1;
    min-width: 200px;
    cursor: pointer;
    position: relative;
    z-index: 100;
}

.upload-section h3 {
    color: #e7e9f5;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 500;
}

.upload-section form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.upload-section input[type="text"],
.upload-section input[type="file"] {
    padding: 10px;
    border: 1px solid #667eea;
    border-radius: 5px;
    background: hsl(232deg 18% 8%);
    color: #e7e9f5;
    font-size: 14px;
    position: relative;
    z-index: 100;
}

.upload-section input[type="text"] {
    flex: 1;
    min-width: 200px;
}

.upload-section input[type="file"] {
    flex: 1;
    min-width: 250px;
}

.upload-section button {
    padding: 10px 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    z-index: 100;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.upload-section button:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3d8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.upload-status {
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
    text-align: center;
}

.upload-status.success {
    color: #4caf50;
}

.upload-status.error {
    color: #e74c3c;
}

/* Files table */
.files-container {
    padding: 30px;
    height: 100%;
    overflow: auto;
}

.files-container h2 {
    color: #e7e9f5;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.table-wrapper {
    overflow-x: auto;
}

#filesTable {
    width: 100%;
    border-collapse: collapse;
    background: hsl(232deg 14% 10%);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid #3b3d3f;
}

#filesTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

#filesTable th {
    padding: 16px 15px;
    text-align: left;
    color: white;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: none;
}

#filesTable td {
    padding: 14px 15px;
    color: #e7e9f5;
    border-bottom: 1px solid #2a2c2e;
    font-size: 14px;
    transition: all 0.3s;
}

#filesTable tbody tr:hover {
    background: linear-gradient(90deg, hsl(232deg 12% 12%) 0%, hsl(250deg 20% 15%) 100%);
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

#filesTable tbody tr:last-child td {
    border-bottom: none;
}

.file-link {
    color: #64b5f6;
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
}

.file-link:hover {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    text-decoration: none;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
}

.delete-btn {
    padding: 6px 12px;
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.delete-btn:hover {
    background: rgba(192, 57, 43, 1);
}

/* iframes */
.content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Hide tabs based on role */
.tab-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        width: 98%;
        margin: 5px auto;
        padding: 0 5px;
    }
    
    .card {
        height: calc(100vh - 70px);
    }
    
    .tabs label.tab {
        font-size: 8pt;
        padding: 10px 5px;
        letter-spacing: 0.05em;
    }
    
    .header {
        padding: 12px 20px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .upload-section form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .upload-section input[type="text"],
    .upload-section input[type="file"] {
        min-width: 100%;
    }
    
    .files-container {
        padding: 15px;
    }
    
    #filesTable {
        font-size: 12px;
    }
    
    #filesTable th,
    #filesTable td {
        padding: 8px;
    }
 }   

/* Files header and controls */
.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 2px solid #3b3d3f;
}

.files-header h2 {
    margin: 0;
}

.files-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #667eea;
    border-radius: 5px;
    background: hsl(232deg 18% 8%);
    color: #e7e9f5;
    font-size: 14px;
    min-width: 250px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.search-input::placeholder {
    color: #888;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #667eea;
    border-radius: 5px;
    background: hsl(232deg 18% 8%);
    color: #e7e9f5;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-select:hover {
    background: hsl(232deg 16% 12%);
    border-color: #764ba2;
}

.filter-select:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.clear-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.clear-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* Sortable table headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.sortable:hover {
    background: hsl(232deg 8% 18%);
}

.sort-icon {
    font-size: 12px;
    margin-left: 5px;
    opacity: 0.5;
}

.sortable.asc .sort-icon::after {
    content: ' ↑';
    opacity: 1;
}

.sortable.desc .sort-icon::after {
    content: ' ↓';
    opacity: 1;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding: 20px 15px;
    border-top: 2px solid #3b3d3f;
    background: hsl(232deg 14% 10%);
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pagination-info {
    color: #ffffff !important;
    font-size: 15px;
    font-weight: 500;
    background: hsl(232deg 10% 15%);
    padding: 10px 15px;
    border-radius: 6px;
    border: 1px solid #667eea;
}

.pagination-info span {
    color: #64b5f6 !important;
    font-weight: 600;
}

.pagination-size {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 500;
    background: hsl(232deg 10% 15%);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #667eea;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-size label,
.pagination-size span {
    color: #ffffff !important;
}

.pagination-size select {
    padding: 8px 12px;
    border: 1px solid #667eea;
    border-radius: 5px;
    background: hsl(232deg 18% 8%);
    color: #e7e9f5;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-size select:hover {
    background: hsl(232deg 16% 12%);
    border-color: #764ba2;
}

.page-btn {
    padding: 8px 14px;
    background: hsl(232deg 14% 10%);
    color: #e7e9f5;
    border: 1px solid #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #3b3d3f;
}

.page-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
}

.page-numbers {
    display: flex;
    gap: 5px;
}

/* Responsive adjustments for pagination and mobile */
@media (max-width: 768px) {
    .files-header {
        flex-direction: column;
        align-items: stretch;
    }

    .files-controls {
        flex-direction: column;
        width: 100%;
    }

    .search-input {
        min-width: 100%;
        width: 100%;
    }

    .filter-select {
        width: 100%;
    }

    .clear-btn {
        width: 100%;
    }

    .pagination-container {
        flex-direction: column;
        gap: 10px;
    }

    .pagination-controls {
        order: 1;
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-info {
        order: 2;
        text-align: center;
    }

    .pagination-size {
        order: 3;
        justify-content: center;
    }

    /* Survey buttons mobile */
    .survey-section {
        padding: 20px;
    }

    .survey-buttons {
        flex-direction: column;
        max-width: 100%;
    }

    .survey-btn {
        min-width: 100%;
        width: 100%;
    }

    /* Category tabs mobile */
    .category-tabs {
        padding: 5px 10px;
        flex-wrap: wrap;
    }

    .category-tab {
        font-size: 12px;
        padding: 10px 15px;
    }

    /* Modal mobile */
    .modal-content {
        width: 98%;
        height: 98%;
        margin: 1% auto;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-header h2 {
        font-size: 18px;
    }
}

.auth-warning {
    background: rgba(255, 152, 0, 0.9);
    border: 2px solid #ffb74d;
    padding: 15px 20px;
    margin: 15px;
    border-radius: 6px;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.auth-warning::before {
    content: "";
    font-size: 20px;
}
