/* =====================================================
   SIDAPRO - Sistem Informasi Database Project
   Design System & Global Styles
   Color Palette: Black, White, Purple
   ===================================================== */

/* CSS Variables */
:root {
    --color-bg-dark: #0a0a0a;
    --color-bg-card: #121212;
    --color-bg-card-hover: #1a1a1a;
    --color-primary: #7c3aed;
    --color-primary-light: #a78bfa;
    --color-primary-dark: #5b21b6;
    --color-white: #ffffff;
    --color-gray-100: #f5f5f5;
    --color-gray-200: #e5e5e5;
    --color-gray-300: #d4d4d4;
    --color-gray-400: #a3a3a3;
    --color-gray-500: #737373;
    --color-gray-600: #525252;
    --color-gray-700: #404040;
    --color-gray-800: #262626;
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;

    --gradient-primary: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    --gradient-dark: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%);
    --gradient-card: linear-gradient(145deg, rgba(124, 58, 237, 0.1) 0%, rgba(10, 10, 10, 0.8) 100%);

    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.4);

    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;

    --font-family: 'Segoe UI', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base Styles */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg-dark);
    color: var(--color-white);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Pattern */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 40%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-white);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-sm {
    max-width: 600px;
}

.container-lg {
    max-width: 1400px;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1rem;
}

h6 {
    font-size: 0.875rem;
}

.text-center {
    text-align: center;
}

.text-primary {
    color: var(--color-primary-light);
}

.text-muted {
    color: var(--color-gray-400);
}

.text-success {
    color: var(--color-success);
}

.text-danger {
    color: var(--color-danger);
}

.text-warning {
    color: var(--color-warning);
}

/* =====================================================
   HOMEPAGE STYLES
   ===================================================== */

.homepage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.logo-container {
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease;
}

.logo {
    width: 216px;
    height: 216px;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(124, 58, 237, 0.3));
    transition: transform var(--transition-normal);
}

.logo:hover {
    transform: scale(1.05);
}

.app-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.app-subtitle {
    font-size: 1rem;
    color: var(--color-gray-400);
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.8s ease 0.4s both;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 24px 32px;
    background: var(--gradient-card);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--border-radius-lg);
    color: var(--color-white);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(124, 58, 237, 0.2), transparent);
    transition: left var(--transition-slow);
}

.menu-btn:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.menu-btn:hover::before {
    left: 100%;
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn-icon {
    font-size: 1.5rem;
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 30px 20px;
    text-align: center;
    animation: fadeIn 1s ease 0.6s both;
}

.copyright {
    font-size: 0.85rem;
    color: var(--color-gray-500);
    letter-spacing: 0.5px;
}

/* =====================================================
   LOGIN PAGE STYLES
   ===================================================== */

.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--gradient-card);
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--border-radius-xl);
    padding: 50px 40px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.5s ease;
}

.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 25px;
    display: block;
    border-radius: 50%;
}

.login-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--color-white);
}

.login-subtitle {
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-gray-400);
    margin-bottom: 35px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-gray-400);
    font-size: 0.9rem;
    margin-bottom: 30px;
    transition: color var(--transition-fast);
}

.back-link:hover {
    color: var(--color-primary-light);
}

/* =====================================================
   FORM STYLES
   ===================================================== */

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray-300);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: var(--color-white);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--color-gray-500);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 45px;
}

.form-select option {
    background: var(--color-bg-dark);
    color: var(--color-white);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   BUTTON STYLES
   ===================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-primary);
}

.btn-success {
    background: var(--color-success);
    color: var(--color-white);
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--color-danger);
    color: var(--color-white);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    background: var(--color-warning);
    color: var(--color-bg-dark);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 18px 36px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* =====================================================
   DASHBOARD STYLES
   ===================================================== */

.dashboard {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: rgba(10, 10, 10, 0.9);
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 15px;
}

.dashboard-logo {
    width: 54px;
    height: 54px;
    border-radius: 50%;
}

.dashboard-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-white);
}

.dashboard-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-white);
}

.user-role {
    font-size: 0.8rem;
    color: var(--color-primary-light);
}

.dashboard-content {
    flex: 1;
    padding: 30px;
}

/* =====================================================
   CARD STYLES
   ===================================================== */

.card {
    background: var(--gradient-card);
    border: 1px solid rgba(124, 58, 237, 0.15);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(124, 58, 237, 0.3);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-white);
}

/* =====================================================
   TABLE STYLES
   ===================================================== */

.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table th {
    background: rgba(124, 58, 237, 0.2);
    color: var(--color-primary-light);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(124, 58, 237, 0.1);
}

.table td {
    color: var(--color-gray-200);
}

/* =====================================================
   BADGE STYLES
   ===================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(124, 58, 237, 0.2);
    color: var(--color-primary-light);
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--color-warning);
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: var(--color-info);
}

/* =====================================================
   MODAL STYLES
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background: var(--color-bg-card);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: var(--border-radius-xl);
    transform: scale(0.9);
    transition: transform var(--transition-normal);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: var(--color-gray-400);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-danger);
    color: var(--color-white);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* =====================================================
   TABS STYLES
   ===================================================== */

.tabs {
    display: flex;
    gap: 5px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: var(--border-radius-md);
    margin-bottom: 25px;
}

.tab {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--color-gray-400);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--color-white);
}

.tab.active {
    background: var(--gradient-primary);
    color: var(--color-white);
}

/* =====================================================
   FILE UPLOAD STYLES
   ===================================================== */

.file-upload {
    position: relative;
    border: 2px dashed rgba(124, 58, 237, 0.4);
    border-radius: var(--border-radius-md);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.file-upload:hover {
    border-color: var(--color-primary);
    background: rgba(124, 58, 237, 0.1);
}

.file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-icon {
    font-size: 2.5rem;
    color: var(--color-primary);
    margin-bottom: 15px;
}

.file-upload-text {
    color: var(--color-gray-300);
    font-size: 0.95rem;
}

.file-upload-hint {
    color: var(--color-gray-500);
    font-size: 0.8rem;
    margin-top: 8px;
}

.file-list {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
    margin-bottom: 10px;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-item-icon {
    color: var(--color-danger);
    font-size: 1.3rem;
}

.file-item-name {
    font-size: 0.9rem;
    color: var(--color-white);
}

.file-item-actions {
    display: flex;
    gap: 8px;
}

/* =====================================================
   ALERT STYLES
   ===================================================== */

.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius-md);
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--color-success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--color-warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--color-info);
}

/* =====================================================
   UTILITY CLASSES
   ===================================================== */

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 {
    gap: 8px;
}

.gap-2 {
    gap: 16px;
}

.gap-3 {
    gap: 24px;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.mb-4 {
    margin-bottom: 32px;
}

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.p-1 {
    padding: 8px;
}

.p-2 {
    padding: 16px;
}

.p-3 {
    padding: 24px;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}

/* =====================================================
   ANIMATIONS
   ===================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease;
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease;
}

.animate-scaleIn {
    animation: scaleIn 0.5s ease;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* =====================================================
   RESPONSIVE DESIGN
   ===================================================== */

@media (max-width: 768px) {
    .app-title {
        font-size: 1.8rem;
    }

    .menu-btn {
        padding: 20px 24px;
        font-size: 1rem;
    }

    .dashboard-header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .dashboard-content {
        padding: 20px;
    }

    .card {
        padding: 20px;
    }

    .login-card {
        padding: 35px 25px;
    }

    .modal {
        margin: 10px;
    }

    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .logo {
        width: 140px;
        height: 140px;
    }

    .app-title {
        font-size: 1.5rem;
    }

    .menu-btn {
        padding: 18px 20px;
    }

    .dashboard-title {
        font-size: 1rem;
    }

    .user-info {
        display: none;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .dashboard-header,
    .btn,
    .no-print {
        display: none !important;
    }

    .card {
        break-inside: avoid;
        border: 1px solid #ddd;
    }

    .table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
}