/* ============================================
   E-TTD System - Stylesheet
   Sistem Tanda Tangan Elektronik SDN 25 Seluma
   ============================================ */

:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --secondary: #2c3e50;
    --accent: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --bg: #f4f6f9;
    --white: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dce1e6;
    --shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 5px 30px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    width: 100%;
    padding: 20px 0;
    text-align: center;
    box-shadow: var(--shadow);
}

.header-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: var(--white);
}

.header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header p {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 4px;
}

/* Navigation Bar */
.nav-bar {
    display: flex;
    gap: 5px;
    background: var(--white);
    padding: 8px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: var(--white);
}

.nav-logout {
    margin-left: auto;
    color: var(--danger);
}

.nav-logout:hover {
    background: #fdedec;
    color: var(--danger);
}

/* Main Container */
.container {
    max-width: 600px;
    width: 95%;
    margin: 30px auto;
    padding: 0 10px;
}

.container-wide {
    max-width: 900px;
}

/* Card */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.card-header {
    background: var(--primary);
    color: var(--white);
    padding: 15px 25px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header .icon {
    font-size: 1.2rem;
}

.card-body {
    padding: 30px 25px;
    text-align: center;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    margin-bottom: 15px;
    text-align: left;
}

.alert-success {
    background: #eafaf1;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

.alert-danger {
    background: #fdedec;
    color: #c0392b;
    border: 1px solid #f5b7b1;
}

/* Form Styles */
.form {
    text-align: left;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    transition: border-color 0.2s;
    background: var(--white);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.12);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.required {
    color: var(--danger);
}

.form-info {
    padding: 12px 16px;
    background: #eaf2f8;
    border-radius: 8px;
    font-size: 0.83rem;
    color: var(--primary);
    margin-bottom: 18px;
}

/* Signature Block */
.signature-block {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 25px 20px;
    margin: 10px 0;
    background: #fafbfc;
}

.signed-by {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 3px;
}

.position {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: -15px;
}

.signature-image {
    max-width: 200px;
    max-height: 120px;
    margin: 10px auto;
    display: block;
}

.signer-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--secondary);
    text-decoration: underline;
    margin-top: -30px;
    margin-bottom: -2px;
}

.signer-nip {
    font-size: 0.9rem;
    color: var(--text);
    margin-top: 1px;
}

/* QR Section */
.qr-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.qr-section p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.qr-code {
    display: inline-block;
    padding: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.qr-code img {
    display: block;
    width: 150px;
    height: 150px;
}

/* Verification Badge */
.verification-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eafaf1;
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 15px;
    border: 1px solid #a9dfbf;
}

.verification-badge.invalid {
    background: #fdedec;
    color: var(--danger);
    border-color: #f5b7b1;
}

/* Verification Result */
.verify-result {
    padding: 20px;
    border-radius: 10px;
    margin: 15px 0;
}

.verify-result.valid {
    background: #eafaf1;
    border: 2px solid #27ae60;
}

.verify-result.invalid {
    background: #fdedec;
    border: 2px solid #e74c3c;
}

.verify-result .status-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.verify-result h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.verify-result p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Info Table */
.info-table {
    width: 100%;
    text-align: left;
    margin-top: 20px;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid var(--border);
}

.info-table td {
    padding: 10px 5px;
    font-size: 0.9rem;
}

.info-table td:first-child {
    font-weight: 600;
    color: var(--text-light);
    width: 40%;
    white-space: nowrap;
}

/* Data Table (Dashboard) */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.data-table thead {
    background: #f0f3f7;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: #f8f9fb;
}

.action-cell {
    white-space: nowrap;
    display: flex;
    gap: 5px;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: 6px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--accent);
    color: var(--white);
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-secondary {
    background: #95a5a6;
    color: var(--white);
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Scan Instruction (Index) */
.scan-instruction {
    padding: 30px 20px 20px;
}

.scan-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.8;
}

.scan-instruction h2 {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 10px;
}

.scan-instruction p {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

.scan-steps {
    margin-top: 25px;
    padding: 0 10px;
    text-align: left;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.step-number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.step-text {
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
    padding-top: 4px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: auto;
    width: 100%;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    .header, .footer, .btn-group, .no-print, .nav-bar {
        display: none !important;
    }
    .card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    .container {
        max-width: 100%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container-wide {
        max-width: 100%;
    }
    .data-table th,
    .data-table td {
        padding: 8px 10px;
        font-size: 0.82rem;
    }
    .action-cell {
        flex-direction: column;
        gap: 4px;
    }
    .nav-bar {
        gap: 3px;
    }
    .nav-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.1rem;
    }
    .card-body {
        padding: 20px 15px;
    }
    .signature-block {
        padding: 15px 10px;
    }
}
