/* Global styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1.6;
}

#app {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    font-weight: 600;
    line-height: 1.2;
}

a {
    color: #4361ee;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Folder Download Instructions Modal */
.folder-instructions-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.folder-instructions-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.folder-instructions-modal .modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 10001;
}

.folder-instructions-modal .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.folder-instructions-modal .modal-header h3 {
    margin: 0;
    color: #374151;
    font-size: 1.25rem;
}

.folder-instructions-modal .modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.folder-instructions-modal .modal-close:hover {
    background: #f3f4f6;
}

.folder-instructions-modal .modal-body {
    padding: 24px;
}

.folder-instructions-modal .instructions-list {
    margin-bottom: 20px;
}

.folder-instructions-modal .instruction-step {
    display: flex;
    margin-bottom: 20px;
    align-items: flex-start;
}

.folder-instructions-modal .step-number {
    background: #4361ee;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.folder-instructions-modal .step-content h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 1rem;
}

.folder-instructions-modal .step-content p {
    margin: 4px 0 0 0;
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.folder-instructions-modal .step-content strong {
    color: #374151;
}

.folder-instructions-modal .instructions-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 16px;
    color: #0369a1;
    font-size: 0.9rem;
}

.folder-instructions-modal .modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    text-align: right;
}

.folder-instructions-modal .btn {
    background: #4361ee;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.folder-instructions-modal .btn:hover {
    background: #3730a3;
}

/* Search functionality styles */
.card-header-with-search {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-container {
    position: relative;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background-color: #fff;
}

.search-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .card-header-with-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        min-width: auto;
    }
}

/* Form help text */
.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Content type badges */
.badge-info {
    background-color: #17a2b8;
    color: white;
}

/* Content type info in student view */
.content-type-info {
    margin-bottom: 12px;
}

.content-description {
    font-size: 14px;
    color: #6c757d;
    margin: 8px 0 0 0;
    font-style: italic;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4361ee;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
}

/* Fullscreen Button Styles */
#fullscreen-btn button {
    animation: pulse 2s infinite;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 123, 255, 0.6);
        transform: translateY(-2px);
    }
    100% {
        box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    }
}

/* Student security mode indicators */
.student-security-mode {
    position: relative;
}

.student-security-mode::before {
    content: "🔒 Secure Mode";
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 150, 0, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

/* Device Approval Management Styles */
.device-approvals-section {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-top: 20px;
}

.approval-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.approval-filters .btn {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    font-size: 14px;
    padding: 8px 16px;
}

.approval-filters .btn:hover {
    background: #e9ecef;
}

.approval-filters .btn.active {
    background: #4361ee;
    color: white;
    border-color: #4361ee;
}

.approval-filters .refresh-btn {
    margin-left: auto;
    background: #28a745;
}

.approval-filters .refresh-btn:hover {
    background: #218838;
}

.devices-grid {
    display: grid;
    gap: 20px;
}

.devices-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.device-count {
    font-weight: 600;
    color: #495057;
    font-size: 16px;
}

.device-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    background: white;
    transition: all 0.3s ease;
}

.device-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.device-card.pending {
    border-color: #ffc107;
    background: #fff9c4;
}

.device-card.approved {
    border-color: #28a745;
    background: #d4edda;
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.device-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #ffc107;
    color: #856404;
}

.status-badge.approved {
    background: #28a745;
    color: white;
}

.device-id {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #6c757d;
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
}

.device-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.device-actions .btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
}

.btn-approve {
    background: #28a745;
}

.btn-approve:hover {
    background: #218838;
}

.btn-deny {
    background: #dc3545;
}

.btn-deny:hover {
    background: #c82333;
}

.btn-revoke {
    background: #fd7e14;
}

.btn-revoke:hover {
    background: #e76500;
}

.device-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.student-info h4 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 16px;
}

.student-info p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.device-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #f1f3f4;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
    color: #495057;
    font-size: 13px;
}

.detail-row .value {
    color: #6c757d;
    font-size: 13px;
    text-align: right;
    max-width: 60%;
    word-break: break-word;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-data p {
    font-size: 16px;
    margin: 0;
}

@media (max-width: 768px) {
    .device-info {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .device-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    
    .device-actions {
        justify-content: center;
    }
    
    .approval-filters {
        flex-direction: column;
    }
    
    .approval-filters .refresh-btn {
        margin-left: 0;
        order: -1;
    }
}

.btn:hover {
    background-color: #3a56d4;
    text-decoration: none;
}

.btn:active {
    transform: translateY(2px);
}

.btn-secondary {
    background-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

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

.btn-info:hover {
    background-color: #138496;
}

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

.btn-danger:hover {
    background-color: #c82333;
}

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

.btn-warning:hover {
    background-color: #e0a800;
}

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

.btn-success:hover {
    background-color: #218838;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 14px;
}

.btn-disabled {
    background-color: #adb5bd;
    cursor: not-allowed;
}

.btn-disabled:hover {
    background-color: #adb5bd;
}

.btn-refresh {
    background-color: transparent;
    color: #4361ee;
    padding: 5px;
}

.btn-refresh:hover {
    background-color: rgba(67, 97, 238, 0.1);
}

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

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group select[multiple] {
    height: auto;
    min-height: 150px;
}

.form-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    margin-bottom: 0;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #4361ee;
    outline: none;
}

.select-group {
    flex: 1;
    min-width: 200px;
}

.datetime-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Card */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 25px;
    margin-bottom: 20px;
}

.card h3 {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* Portal Selection */
.portal-selection {
    max-width: 800px;
    width: 100%;
}

.portal-cards {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.portal-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    flex: 1;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 200px;
    max-width: 300px;
}

.portal-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.portal-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.portal-card h3 {
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.portal-card p {
    color: #6b7280;
    margin-bottom: 0;
}

/* Login */
.login-container {
    max-width: 400px;
    width: 100%;
}

.login-card {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
}

/* Dashboard */
.dashboard {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 250px;
    background-color: #1a1a2e;
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #2d2d42;
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.sidebar-header p {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.7;
}

.sidebar-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    padding: 0;
}

.sidebar-menu a {
    padding: 15px 20px;
    display: block;
    color: #e1e1e1;
    text-decoration: none;
    transition: background-color 0.2s;
    border-left: 4px solid transparent;
}

.sidebar-menu a:hover {
    background-color: #2d2d42;
}

.sidebar-menu a.active {
    background-color: #2d2d42;
    border-left-color: #4361ee;
    font-weight: 500;
}

.main-content {
    flex: 1;
    background-color: #f5f7fb;
    padding: 20px 30px;
    overflow-y: auto;
}

/* Content */
.content-header {
    margin-bottom: 25px;
}

.content-title {
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.content-subtitle {
    color: #6c757d;
    margin: 0;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin-top: 10px;
}

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

.table th {
    background-color: #f1f3f9;
    font-weight: 600;
    text-align: left;
}

.table th,
.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
}

.table tr:last-child td {
    border-bottom: none;
}

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

.actions {
    white-space: nowrap;
}

.actions button {
    margin-right: 5px;
}

.actions button:last-child {
    margin-right: 0;
}

/* Status indicators */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.available {
    background-color: #d1f8d9;
    color: #0e6624;
}

.status-badge.scheduled {
    background-color: #ffeeba;
    color: #856404;
}

.status-badge.disabled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Alerts */
#alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 400px;
}

.alert {
    padding: 15px 20px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-weight: 500;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slide-in 0.3s ease-out;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.timer-warning {
    margin-top: 15px;
}

.timer-warning .alert-info {
    margin-bottom: 15px;
    font-size: 14px;
}

.close-alert {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

/* Empty states & loading */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.loading {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    padding: 20px;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 4px;
}

/* Video player */
.video-container {
    position: relative;
    width: 100%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Overlay to hide pop-out button in video player */
.video-overlay::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background-color: transparent;
    pointer-events: auto;
    z-index: 10;
    cursor: default;
}

.timer-display {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    margin-bottom: 15px;
    display: inline-block;
}

.video-controls,
.notes-controls {
    margin-top: 20px;
}

/* Refresh button */
.refresh-container {
    display: flex;
    justify-content: flex-end;
}

/* Modal styles */
.modal {
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    position: relative;
    animation: modal-appear 0.3s;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
}

.close-modal:hover {
    color: #4361ee;
}

@keyframes modal-appear {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

/* Media queries */
@media (max-width: 768px) {
    .portal-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .dashboard {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .datetime-group {
        flex-direction: column;
        gap: 0;
    }
}

/* Upload-specific styles */
.tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: #4361ee;
}

.tab-btn.active {
    color: #4361ee;
    border-bottom-color: #4361ee;
}

.tab-content {
    display: none;
}

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

input[type="file"] {
    padding: 10px 0;
}

.upload-progress {
    margin: 15px 0;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.progress {
    height: 100%;
    background-color: #4361ee;
    border-radius: 5px;
    width: 0%;
    transition: width 0.3s;
}

#upload-status {
    font-size: 14px;
    margin: 0;
}/* Class Notes Styling */
.notes-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

/* Two-column layout for Commercial Law I and II */
.notes-two-column {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.notes-column {
    flex: 1;
    min-width: 0;
}

.notes-section-heading {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #4285f4;
    text-align: center;
}

.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.note-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
}

.note-name {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    flex: 1;
}

.btn-download {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.btn-download:hover {
    background-color: #3367d6;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .notes-two-column {
        flex-direction: column;
        gap: 30px;
    }
    
    .notes-section-heading {
        font-size: 20px;
    }
}