/* style.css - Modern Design System for LPJ Pencairan PIP */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --secondary: #06b6d4;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --bg-main: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', sans-serif;
    --transition-all: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
    background-attachment: fixed;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphism Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.5px;
    transition: var(--transition-all);
}

.logo span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition-all);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

.btn-login {
    background: linear-gradient(to right, var(--primary), var(--primary-dark));
    color: white !important;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Glassmorphism Card Wrapper */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
    transition: var(--transition-all);
}

.glass-card:hover {
    box-shadow: var(--shadow-xl);
    border-color: rgba(79, 70, 229, 0.2);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0 40px;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Search Box Container */
.search-container {
    max-width: 600px;
    margin: 0 auto 50px;
}

.search-form {
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transition: var(--transition-all);
}

.search-form:focus-within {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.15);
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 16px;
    font-size: 1.05rem;
    font-family: var(--font-sans);
    background: transparent;
}

.btn-search {
    background: var(--primary);
    color: white;
    border: none;
    outline: none;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-all);
}

.btn-search:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-all);
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition-all);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-title {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.2;
}

/* Table Design */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin-top: 15px;
}

th {
    background: rgba(241, 245, 249, 0.8);
    padding: 14px 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

td {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    color: var(--text-main);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(248, 250, 252, 0.6);
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-warning {
    background-color: var(--warning-light);
    color: #b45309;
}

.badge-success {
    background-color: var(--success-light);
    color: #047857;
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    font-weight: 500;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    color: #065f46;
    border-left-color: var(--success);
}

.alert-danger {
    background-color: var(--danger-light);
    color: #991b1b;
    border-left-color: var(--danger);
}

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

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    outline: none;
    transition: var(--transition-all);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control:disabled {
    background: #f1f5f9;
    color: var(--text-muted);
}

/* Checkbox Grid Group */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-all);
}

.checkbox-label:hover {
    border-color: var(--primary-light);
    background: rgba(79, 70, 229, 0.02);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* File Upload Premium Styling */
.file-upload-wrapper {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 30px;
    text-align: center;
    background: white;
    cursor: pointer;
    transition: var(--transition-all);
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.02);
}

.file-upload-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

/* Image Preview Container */
.preview-container {
    margin-top: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
    max-height: 300px;
    border: 1px solid var(--border-color);
    display: none;
    position: relative;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f1f5f9;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 50px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Admin Specific */
@media (min-width: 769px) {
    body.admin-body {
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body.admin-body header {
        flex-shrink: 0;
    }

    body.admin-body header .container {
        max-width: 100%;
        padding: 0 24px;
    }

    body.admin-body .admin-layout {
        flex: 1;
        display: flex;
        height: calc(100vh - 70px);
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    body.admin-body .sidebar {
        width: 260px;
        height: 100%;
        overflow-y: auto;
        flex-shrink: 0;
        padding: 24px 16px;
        background: white;
        border-right: 1px solid var(--border-color);
    }

    body.admin-body .admin-main {
        flex: 1;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding: 24px;
        background: #f1f5f9;
        min-width: 0; /* Prevent horizontal stretching of flex content */
    }

    .admin-content-wrapper {
        flex: 1;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding-right: 4px;
        width: 100%;
        min-width: 0; /* Prevent horizontal stretching */
    }
}

/* Fallbacks for non-fullscreen or mobile view */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--border-color);
    padding: 30px 20px;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition-all);
}

.sidebar-link:hover, .sidebar-link.active {
    color: var(--primary);
    background: rgba(79, 70, 229, 0.08);
}

.admin-main {
    flex: 1;
    padding: 40px;
    background: #f1f5f9;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-xl);
    animation: fadeIn 0.3s ease-out forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

/* Detail Bukti Foto (LPJ) styling */
.img-bukti-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: var(--transition-all);
}

.img-bukti-thumb:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

/* Media Queries */
@media (max-width: 992px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .admin-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 20px;
    }
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    .hero {
        padding: 30px 0 15px;
    }
    .hero h1 {
        font-size: 1.8rem;
        word-wrap: break-word;
    }
    .hero p {
        font-size: 0.92rem;
    }
    .search-container {
        margin-bottom: 30px;
    }
    .search-form {
        flex-direction: column;
        gap: 8px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.95);
    }
    .search-input {
        width: 100%;
        padding: 10px;
        text-align: center;
        background: #f8fafc;
        border: 1px solid #cbd5e1;
        border-radius: var(--radius-sm);
    }
    .btn-search {
        width: 100%;
        text-align: center;
        padding: 12px;
    }
}

/* Student Portal Full-Screen Layout (Laptops & Desktops) */
@media (min-width: 769px) {
    body.student-body {
        height: 100vh;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    body.student-body header {
        flex-shrink: 0;
    }

    body.student-body main.container {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        padding-top: 16px;
        padding-bottom: 16px;
        max-width: 1200px;
        width: 100%;
        min-width: 0;
    }

    body.student-body .hero {
        padding: 24px 0 16px;
        transition: var(--transition-all);
    }

    /* Hide hero completely when showing results to fit on 1 laptop screen */
    body.student-body.has-results .hero {
        display: none;
    }

    body.student-body.has-results .search-container {
        margin-bottom: 20px;
    }

    .student-content-wrapper {
        flex: 1;
        overflow-y: auto;
        padding-right: 4px;
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
        min-width: 0;
    }
    
    .student-content-wrapper footer {
        margin-top: auto;
        padding: 24px 0;
    }
}

.student-content-wrapper footer {
    margin-top: 40px;
}
