/* ================================================
   MERCHANT GATEWAY MANAGER - PREMIUM CSS
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FF6B35;
    --primary-dark: #E55100;
    --primary-light: #FF8555;
    --secondary: #004E89;
    --secondary-light: #1565A0;
    --accent: #00A8E8;
    --accent-light: #00D4FF;
    --success: #00B84D;
    --danger: #FF3333;
    --warning: #FFB820;
    --dark: #1A1A1A;
    --darkgrey: #2D2D2D;
    --lightgrey: #F5F5F5;
    --white: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-secondary: #333333;
    --border: #E0E0E0;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

/* ================================================
   TYPOGRAPHY
   ================================================ */

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-secondary);
}

h5 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-light);
}

/* ================================================
   NAVBAR & HEADER
   ================================================ */

.navbar {
    background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary-light) 100%);
    padding: 1.2rem 2rem;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.navbar-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navbar-menu a {
    color: var(--white);
    font-weight: 600;
    position: relative;
    padding: 0.5rem 0;
}

.navbar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--accent);
    transition: var(--transition);
}

.navbar-menu a:hover::after {
    width: 100%;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 800;
}

/* ================================================
   SIDEBAR
   ================================================ */

.sidebar {
    background: linear-gradient(180deg, var(--darkgrey) 0%, #1f1f1f 100%);
    width: 250px;
    min-height: 100vh;
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    color: #ddd;
    font-weight: 600;
    transition: var(--transition);
    border-left: 4px solid transparent;
    font-size: 1.05rem;
}

.sidebar-menu a:hover {
    background: rgba(255, 107, 53, 0.1);
    border-left-color: var(--primary);
    color: var(--primary);
}

.sidebar-menu a.active {
    background: rgba(255, 107, 53, 0.2);
    border-left-color: var(--primary);
    color: var(--primary);
}

/* ================================================
   MAIN CONTENT
   ================================================ */

.admin-wrapper {
    margin-left: 250px;
    margin-top: 70px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ================================================
   CARDS & BOXES
   ================================================ */

.card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: var(--transition);
    border: 1px solid #f0f0f0;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ================================================
   FORMS & INPUTS
   ================================================ */

.form-group {
    margin-bottom: 1.8rem;
}

.form-group label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.7rem;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.form-group .required {
    color: var(--danger);
    margin-left: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.95rem 1.2rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-primary);
    transition: var(--transition);
    background: var(--white);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 168, 232, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

select {
    cursor: pointer;
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
    display: inline-block;
    padding: 0.95rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0, 78, 137, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 78, 137, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success) 0%, #007533 100%);
    color: var(--white);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 77, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger) 0%, #CC0000 100%);
    color: var(--white);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 51, 51, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning) 0%, #FF9500 100%);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-small {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ================================================
   TABLES
   ================================================ */

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

thead {
    background: linear-gradient(90deg, var(--secondary) 0%, var(--secondary-light) 100%);
}

thead th {
    color: var(--white);
    padding: 1.2rem;
    font-weight: 700;
    text-align: left;
    font-size: 1.05rem;
}

tbody td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1rem;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: rgba(255, 107, 53, 0.05);
}

tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 0.5rem;
}

.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-primary {
    background: rgba(255, 107, 53, 0.2);
    color: var(--primary);
}

.badge-secondary {
    background: rgba(0, 168, 232, 0.2);
    color: var(--accent);
}

.badge-success {
    background: rgba(0, 184, 77, 0.2);
    color: var(--success);
}

.badge-danger {
    background: rgba(255, 51, 51, 0.2);
    color: var(--danger);
}

/* ================================================
   ALERTS & MESSAGES
   ================================================ */

.alert {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    font-weight: 600;
    font-size: 1.05rem;
    border-left: 5px solid;
}

.alert-success {
    background: rgba(0, 184, 77, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(255, 51, 51, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: rgba(255, 184, 32, 0.1);
    border-color: var(--warning);
    color: #CC8800;
}

.alert-info {
    background: rgba(0, 168, 232, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

/* ================================================
   GRID LAYOUT
   ================================================ */

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.col-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.col-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

@media (max-width: 768px) {
    .col-2,
    .col-3 {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   STAT BOXES
   ================================================ */

.stat-box {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--primary);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ================================================
   MODALS
   ================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    float: right;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
}

.modal-close:hover {
    color: var(--primary);
}

/* ================================================
   LOADING & SPINNER
   ================================================ */

.spinner {
    border: 4px solid rgba(255, 107, 53, 0.2);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .admin-wrapper {
        margin-left: 0;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        position: relative;
        padding: 1rem 0;
    }

    .sidebar-menu a {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }

    .navbar {
        padding: 1rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }

    .navbar-menu {
        gap: 1rem;
    }

    .col-2,
    .col-3 {
        grid-template-columns: 1fr;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="url"],
    input[type="tel"],
    select,
    textarea {
        font-size: 16px;
    }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.text-primary { color: var(--primary); }
.text-secondary { color: var(--accent); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.bold { font-weight: 700; }
.italic { font-style: italic; }

.hidden { display: none !important; }
.visible { display: block !important; }