/* ===================================
   Branch Application System - Styles
   =================================== */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #38ef7d;
    --danger: #ff6b6b;
    --warning: #feca57;
    --info: #54a0ff;
    --dark: #2d3436;
    --light: #f8f9fa;
    --gray: #636e72;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.6;
}

/* ===== Container ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Glass Card ===== */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card-header {
    text-align: center;
    margin-bottom: 30px;
}

.card-header h1 {
    font-size: 2rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.card-header p {
    color: var(--gray);
}

/* ===== Progress Bar ===== */
.progress-container {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.progress-container::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    transition: all 0.4s ease;
}

.step-number.active {
    background: var(--gradient);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    transform: scale(1.1);
}

.step-number.completed {
    background: var(--success);
}

.step-label {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--gray);
    text-align: center;
}

/* ===== Form Steps ===== */
.form-step {
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Form Groups ===== */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group label .required {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #aaa;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* ===== Radio Buttons ===== */
.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.radio-option {
    flex: 1;
    position: relative;
}

.radio-option input {
    position: absolute;
    opacity: 0;
}

.radio-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.radio-option input:checked+label {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.radio-option label:hover {
    border-color: var(--primary);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--gray);
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: #fff;
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

/* ===== Alerts ===== */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(56, 239, 125, 0.1);
    border: 1px solid var(--success);
    color: #0d7a3a;
}

.alert-danger {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid var(--danger);
    color: #c0392b;
}

.alert-warning {
    background: rgba(254, 202, 87, 0.1);
    border: 1px solid var(--warning);
    color: #9a6700;
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    margin-top: 20px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.table th,
.table td {
    padding: 15px;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.table th {
    background: var(--gradient);
    color: #fff;
    font-weight: 600;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ===== Status Badges ===== */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-pending {
    background: rgba(254, 202, 87, 0.2);
    color: #9a6700;
}

.badge-reviewed {
    background: rgba(84, 160, 255, 0.2);
    color: #2576b9;
}

.badge-accepted {
    background: rgba(56, 239, 125, 0.2);
    color: #0d7a3a;
}

.badge-rejected {
    background: rgba(255, 107, 107, 0.2);
    color: #c0392b;
}

/* ===== Stats Cards ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    box-shadow: var(--shadow);
    border-right: 4px solid var(--primary);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .stat-label {
    color: var(--gray);
    margin-top: 5px;
}

.stat-card.success {
    border-right-color: var(--success);
}

.stat-card.danger {
    border-right-color: var(--danger);
}

.stat-card.warning {
    border-right-color: var(--warning);
}

.stat-card.info {
    border-right-color: var(--info);
}

/* ===== Admin Layout ===== */
.admin-header {
    background: var(--gradient);
    color: #fff;
    padding: 20px 0;
    margin-bottom: 30px;
}

.admin-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-nav {
    display: flex;
    gap: 15px;
}

.admin-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ===== Application Detail ===== */
.detail-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-row {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.detail-label {
    font-weight: 600;
    color: var(--gray);
}

.detail-value {
    color: var(--dark);
}

/* ===== Login Page ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo .icon {
    width: 80px;
    height: 80px;
    background: var(--gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2rem;
    color: #fff;
}

/* ===== Success Page ===== */
.success-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.success-card {
    text-align: center;
    max-width: 500px;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #11998e, #38ef7d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
    font-size: 3rem;
    color: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* ===== Responsive - Mobile First ===== */

/* Extra Small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 10px;
        width: 100%;
    }

    .card {
        padding: 20px 15px;
        margin: 10px;
        border-radius: 15px;
    }

    .card-header h1 {
        font-size: 1.25rem;
    }

    .card-header p {
        font-size: 0.9rem;
    }

    /* Progress Steps Mobile */
    .progress-container {
        padding: 0 10px;
    }

    .progress-container::before {
        left: 20px;
        right: 20px;
    }

    .progress-step {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }

    .step-label {
        font-size: 0.65rem;
        max-width: 60px;
    }

    /* Form Elements Mobile */
    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 5px;
    }

    .form-control {
        padding: 12px 15px;
        font-size: 16px;
        /* Prevents zoom on iOS */
        border-radius: 10px;
    }

    select.form-control {
        padding-right: 40px;
    }

    textarea.form-control {
        min-height: 100px;
    }

    /* Buttons Mobile */
    .btn {
        padding: 14px 20px;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }

    .btn-group {
        flex-direction: column;
        gap: 10px;
    }

    .btn-group .btn {
        margin: 0;
    }

    /* Radio Group Mobile */
    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .radio-option {
        padding: 15px;
    }

    /* Admin Header Mobile */
    .admin-header {
        padding: 15px 0;
    }

    .admin-header .container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .admin-header h1 {
        font-size: 1.25rem;
    }

    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .admin-nav a {
        padding: 8px 15px;
        font-size: 0.85rem;
    }

    /* Stats Cards Mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 15px;
    }

    .stat-card .number {
        font-size: 1.5rem;
    }

    .stat-card .label {
        font-size: 0.75rem;
    }

    /* Table Mobile - Card View */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        font-size: 0.85rem;
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: 10px 8px;
    }

    /* Details Page Mobile */
    .detail-row {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .detail-label {
        margin-bottom: 2px;
        font-size: 0.85rem;
    }

    .detail-value {
        font-size: 0.95rem;
    }

    .detail-section {
        padding: 15px;
        margin-bottom: 15px;
    }

    .detail-section h3 {
        font-size: 1.1rem;
    }

    /* Action Buttons Mobile */
    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .action-buttons .btn {
        width: 100%;
    }

    /* Badge Mobile */
    .badge {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    /* Login Page Mobile */
    .login-wrapper {
        padding: 15px;
    }

    .login-card {
        padding: 25px 20px;
    }

    .login-logo .icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    /* Success Page Mobile */
    .success-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    /* Filters Mobile */
    .filters {
        flex-direction: column;
        gap: 10px;
    }

    .filters select,
    .filters input {
        width: 100%;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        padding: 15px;
    }

    .card {
        padding: 25px;
    }

    .card-header h1 {
        font-size: 1.4rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .btn-group {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .detail-row {
        grid-template-columns: 1fr 2fr;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .admin-header .container {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .table {
        font-size: 0.95rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

    .btn,
    .form-control,
    .radio-option,
    select {
        min-height: 48px;
        /* Minimum touch target size */
    }

    .table td,
    .table th {
        padding: 12px 10px;
    }

    /* Remove hover effects on touch devices */
    .btn:hover {
        transform: none;
    }

    .card:hover {
        transform: none;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {

    .admin-header,
    .container,
    footer {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    footer {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Print styles */
@media print {

    .admin-nav,
    .btn,
    .action-buttons {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}