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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    color: #2c3e50;
    background-color: #f8f9fa;
    letter-spacing: 0.3px;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 400px;
    max-width: 90vw;
}

.login-form .logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-form .logo h1 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-form .logo p {
    color: #666;
    font-size: 0.9rem;
}

/* Dashboard Styles */
.dashboard-container {
    min-height: 100vh;
    background-color: #f8f9fa;
}

.dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.dashboard-header .logo h1 {
    font-size: 1.8rem;
    margin-bottom: 0.2rem;
}

.dashboard-header .logo p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.logout-form {
    margin: 0;
}

.dashboard-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.dashboard-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.button-card {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.button-card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.button-card p {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Form Styles */
.form-container {
    max-width: 1200px;
    margin: 3rem auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.form-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 3rem;
    text-align: center;
    position: relative;
}

.form-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.form-header .logo {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 1.5rem;
    font-weight: bold;
}

.form-info {
    background: #e8f2ff;
    padding: 3rem;
    border-left: 6px solid #667eea;
    margin: 0;
}

.form-info p {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

.form-info p:last-child {
    margin-bottom: 0;
}

#merchant-form {
    padding: 4rem;
}

.form-section {
    margin-bottom: 5rem;
    padding: 3.5rem;
    background: #fafbfc;
    border-radius: 15px;
    border: 1px solid #e9ecef;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    color: #667eea;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #e9ecef;
    position: relative;
    letter-spacing: 0.5px;
}

.section-title::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: #667eea;
}

.form-group {
    margin-bottom: 3rem;
}

.form-group label {
    display: block;
    margin-bottom: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.15rem;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 1.5rem;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1.05rem;
    transition: all 0.3s ease;
    background-color: white;
    line-height: 1.7;
    letter-spacing: 0.3px;
    margin-bottom: 0.5rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #fff;
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.8;
}

.radio-group {
    display: flex;
    gap: 3rem;
    margin-top: 1.2rem;
    padding: 2rem;
    background: white;
    border-radius: 10px;
    border: 2px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 500;
    margin-bottom: 0;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.radio-group label:hover {
    background-color: #f8f9fa;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 0.75rem;
    transform: scale(1.2);
    accent-color: #667eea;
}

/* History Table */
.history-table {
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
}

.history-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.history-table th,
.history-table td {
    padding: 1.25rem;
    text-align: left;
    border: 1px solid #e9ecef;
    vertical-align: middle;
}

.history-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 0.9rem;
}

.history-table input {
    width: 100%;
    padding: 1rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.history-table input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.history-table td:first-child {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    min-width: 150px;
}

/* Button Styles */
.btn-primary,
.btn-secondary,
.btn-success,
.btn-danger,
.btn-warning {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-content.large {
    max-width: 800px;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

.link-container {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.link-container input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e5e9;
    border-radius: 5px;
    font-size: 1rem;
}

/* Applications List */
.applications-main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.filter-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.tab-btn.active,
.tab-btn:hover {
    background: #667eea;
    color: white;
}

.applications-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.application-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.application-header h3 {
    color: #333;
    font-size: 1.1rem;
}

.status {
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status.pending {
    background: #fff3cd;
    color: #856404;
}

.status.submitted {
    background: #d1ecf1;
    color: #0c5460;
}

.status.approved {
    background: #d4edda;
    color: #155724;
}

.status.declined {
    background: #f8d7da;
    color: #721c24;
}

.application-info p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: #666;
}

.application-details {
    max-height: 400px;
    overflow-y: auto;
}

.detail-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.detail-section:last-child {
    border-bottom: none;
}

.detail-section h4 {
    color: #667eea;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.detail-section p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Messages */
.error-message,
.success-message {
    padding: 1rem;
    border-radius: 5px;
    margin-top: 1rem;
    text-align: center;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    text-align: center;
    padding: 4rem 3rem;
    border-radius: 20px;
    margin: 3rem 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.success-message h2 {
    font-size: 2.5rem;
    margin: 0;
    color: #155724;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.loading,
.no-applications,
.error {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1.1rem;
}

.form-footer {
    text-align: center;
    padding: 4rem 3rem;
    margin-top: 3rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.form-footer p {
    margin-bottom: 2.5rem;
    color: #495057;
    font-size: 1.15rem;
    line-height: 1.8;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .dashboard-buttons {
        grid-template-columns: 1fr;
    }

    .form-container {
        margin: 1rem;
        border-radius: 0;
    }

    .history-table {
        font-size: 0.8rem;
    }

    .link-container {
        flex-direction: column;
    }

    .applications-list {
        grid-template-columns: 1fr;
    }

    .filter-tabs {
        flex-wrap: wrap;
    }

    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }

    .modal-actions {
        flex-direction: column;
    }
}

/* Delete button styles */
.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delete-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.delete-btn:hover {
    background: #c82333;
}

/* Download link styles */
.download-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.download-link:hover {
    color: #0056b3;
    text-decoration: underline;
}