/**
 * KASU PDF Protection System
 * Main Stylesheet
 */

/* ========================================
   1. ROOT VARIABLES
   ======================================== */
:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --body-bg: #f5f7fb;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --border-radius: 0.5rem;
    --transition-speed: 0.3s;
}

/* ========================================
   2. BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
    transition: color var(--transition-speed);
}

/* ========================================
   3. AUTHENTICATION PAGES
   ======================================== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo i {
    font-size: 3rem;
    color: var(--primary-color);
}

.auth-logo-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.navbar-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-top: 0.5rem;
}

.auth-logo p {
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.auth-form .form-control {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #dee2e6;
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.auth-form .btn-primary {
    padding: 0.75rem;
    font-weight: 500;
    border-radius: var(--border-radius);
}

.auth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dee2e6;
}

.auth-divider span {
    background: white;
    padding: 0 1rem;
    position: relative;
    color: var(--secondary-color);
    font-size: 0.875rem;
}

/* ========================================
   4. DASHBOARD
   ======================================== */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--dark-color);
}

.page-header p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* Stats Cards */
.stats-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    transition: box-shadow var(--transition-speed);
    border: none;
    height: 100%;
}

.stats-card:hover {
    box-shadow: var(--card-shadow-hover);
}

.stats-card .icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stats-card .icon.bg-primary-soft {
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

.stats-card .icon.bg-success-soft {
    background: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.stats-card .icon.bg-warning-soft {
    background: rgba(255, 193, 7, 0.1);
    color: var(--warning-color);
}

.stats-card .icon.bg-info-soft {
    background: rgba(13, 202, 240, 0.1);
    color: var(--info-color);
}

.stats-card .icon.bg-danger-soft {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.stats-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
}

.stats-card .label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Content Cards */
.content-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    border: none;
}

.content-card .card-header {
    background: transparent;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

.content-card .card-header h5 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
}

.content-card .card-body {
    padding: 1.5rem;
}

/* ========================================
   5. TABLES
   ======================================== */
.table-responsive {
    border-radius: var(--border-radius);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: var(--light-color);
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
    white-space: nowrap;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.02);
}

/* ========================================
   6. BUTTONS
   ======================================== */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all var(--transition-speed);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ========================================
   7. FORMS
   ======================================== */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-control,
.form-select {
    border-radius: var(--border-radius);
    padding: 0.625rem 1rem;
    border: 1px solid #dee2e6;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-text {
    font-size: 0.8125rem;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    padding: 3rem;
    text-align: center;
    background: var(--light-color);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.02);
}

.file-upload-wrapper.dragover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-wrapper i {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.file-upload-wrapper p {
    color: var(--secondary-color);
    margin-bottom: 0;
}

/* ========================================
   8. PDF VIEWER
   ======================================== */
.pdf-viewer-wrapper {
    background: #525659;
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

.pdf-viewer-toolbar {
    background: #323639;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pdf-viewer-toolbar .btn {
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
}

.pdf-viewer-toolbar .btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pdf-viewer-container {
    height: 600px;
    overflow: auto;
}

.pdf-viewer-container canvas {
    display: block;
    margin: 0 auto;
}

/* Password Modal for PDF */
.pdf-password-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.pdf-password-box {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 350px;
    width: 100%;
}

/* ========================================
   9. FILE CARDS
   ======================================== */
.file-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    padding: 1.5rem;
    height: 100%;
    transition: all var(--transition-speed);
    border: 1px solid transparent;
}

.file-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--primary-color);
}

.file-card .file-icon {
    width: 80px;
    height: 80px;
    background: rgba(220, 53, 69, 0.1);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--danger-color);
    margin: 0 auto 1rem;
}

.file-card .file-name {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.file-card .file-meta {
    font-size: 0.8125rem;
    color: var(--secondary-color);
}

/* ========================================
   10. BADGES & STATUS
   ======================================== */
.badge {
    font-weight: 500;
    padding: 0.4em 0.65em;
    border-radius: 0.35rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.active::before {
    background: var(--success-color);
}

.status-badge.inactive::before {
    background: var(--danger-color);
}

/* ========================================
   11. ALERTS
   ======================================== */
.alert {
    border-radius: var(--border-radius);
    border: none;
}

/* ========================================
   12. PROFILE PAGE
   ======================================== */
.profile-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem 1.5rem;
    text-align: center;
    color: white;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin: 0 auto 1rem;
}

.profile-body {
    padding: 1.5rem;
}

.pdf-password-display {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.pdf-password-display .password {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.1em;
    margin: 0.5rem 0;
}

/* ========================================
   13. SETTINGS PAGE
   ======================================== */
.settings-group {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
}

.settings-group-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: var(--dark-color);
}

.settings-group-body {
    padding: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #e9ecef;
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-item:first-child {
    padding-top: 0;
}

.setting-item .setting-info h6 {
    margin: 0;
    font-weight: 600;
}

.setting-item .setting-info p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--secondary-color);
}

/* Toggle Switch */
.form-switch .form-check-input {
    width: 3rem;
    height: 1.5rem;
    cursor: pointer;
}

/* ========================================
   14. RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.5rem;
    }
    
    .stats-card {
        margin-bottom: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    .content-card .card-header,
    .content-card .card-body {
        padding: 1rem;
    }
}

/* ========================================
   15. UTILITIES
   ======================================== */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Prevent PDF download */
.pdf-protected {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
