/**
 * Custom Styles
 * Kalkulator Waris
 */

/* Global Styles */
:root {
    --primary-color: #198754;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

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

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

main {
    flex: 1;
}

/* Navbar */
.navbar-brand {
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 5px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-header {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    border: none;
    padding: 1.2rem;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.6rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #157347 0%, #0d4d2d 100%);
}

/* Footer */
footer {
    margin-top: auto;
}

footer a:hover {
    color: white !important;
    transform: translateX(5px);
    transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Badge Custom */
.badge {
    padding: 0.5em 0.8em;
    font-weight: 500;
    border-radius: 6px;
}

/* Table Custom */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: white;
}

/* Form Control */
.form-control:focus,
.form-select:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* Alert */
.alert {
    border-radius: 10px;
    border: none;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
}

.min-vh-50 {
    min-height: 50vh;
}

/* Feature Icon */
.feature-icon {
    width: 80px;
    height: 80px;
}

/* Step Number */
.step-number {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Hover Effects */
.card {
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
}

/* Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate__fadeInLeft {
    animation: fadeInLeft 0.8s ease-out;
}

/* Responsive Hero */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
}

/* Calculator Page Styles */
.hover-card {
    transition: all 0.3s ease;
    cursor: pointer;
}

.hover-card:hover {
    background-color: #f8f9fa;
    border-color: #198754 !important;
    transform: translateX(5px);
}

.form-check-input:checked + .form-check-label .hover-card {
    background-color: #d1e7dd;
    border-color: #198754 !important;
}

.form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

/* Arabic text styling */
[dir="rtl"] {
    text-align: right;
    font-family: 'Arial', sans-serif;
}

/* Print Styles */
@media print {
    @page {
        margin: 1.5cm;
        size: A4;
    }
    
    body {
        font-size: 11pt;
        color: #000;
    }
    
    /* Hide elements */
    nav, footer, .d-print-none, .btn {
        display: none !important;
    }
    
    /* Card styles */
    .card {
        border: 1px solid #000 !important;
        box-shadow: none !important;
        margin-bottom: 1rem;
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    /* Table */
    .table {
        font-size: 10pt;
        border-collapse: collapse;
    }
    
    .table thead {
        background-color: #f8f9fa !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .table td, .table th {
        border: 1px solid #dee2e6 !important;
        padding: 0.5rem !important;
    }
    
    /* Badge */
    .badge {
        border: 1px solid currentColor !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Colors for print */
    .text-success {
        color: #198754 !important;
    }
    
    .bg-success {
        background-color: #198754 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* Alert */
    .alert {
        border: 1px solid #000 !important;
        page-break-inside: avoid;
    }
    
    /* Prevent page breaks */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .card-header {
        page-break-after: avoid;
    }
}

/* Hasil page specific styles */
.table-hover tbody tr:hover {
    background-color: rgba(25, 135, 84, 0.05);
}

.opacity-50 {
    opacity: 0.5 !important;
}

dl dt {
    font-weight: 600;
}

dl dd {
    margin-bottom: 0.5rem;
}

/* Admin Access Section */
.bg-dark {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
}

.admin-section {
    border-top: 3px solid #198754;
}

.admin-section .btn-outline-light:hover {
    background-color: #198754;
    border-color: #198754;
    transform: translateY(-2px);
}

/* Admin Badge */
.admin-badge {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hover effects for admin links */
a[href*="admin"] {
    transition: all 0.3s ease;
}

a[href*="admin"]:hover {
    transform: translateX(3px);
}