/* ====================================
   Shitokai Karate Do Federation Sri Lanka - Global Styles
   ==================================== */

:root {
    --primary-color: #d32f2f;
    --primary-light: #ef5350;
    --primary-dark: #c62828;
    --secondary-color: #1976d2;
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --border-color: #e0e0e0;
    --success-color: #388e3c;
    --warning-color: #f57c00;
    --error-color: #d32f2f;
    --sidebar-width: 280px;
    --header-height: 80px;
    --footer-height: 60px;
}

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

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--background-color);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ====================================
   Layout Structure
   ==================================== */

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

.app-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px 30px;
    height: var(--header-height);
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-section h1 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
}

.logo-section .tagline {
    font-size: 12px;
    opacity: 0.9;
    margin: 5px 0 0 0;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    font-size: 14px;
}

.btn-logout {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
    cursor: pointer;
}

.btn-logout:hover {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ====================================
   Content Layout
   ==================================== */

.app-content {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height) - var(--footer-height));
    overflow: hidden;
}

.app-sidebar {
    width: var(--sidebar-width);
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 20px 0;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
    height: 100%;
    position: relative;
}

.main-nav {
    display: flex;
    flex-direction: column;
}

.nav-section {
    margin-bottom: 30px;
    padding: 0 15px;
}

.nav-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 8px;
}

.nav-link {
    display: block;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background-color: var(--background-color);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
}

.nav-link.active {
    background-color: var(--background-color);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* ====================================
   Main Content Area
   ==================================== */

.app-main {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    height: 100%;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.page-header {
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 15px;
}

.page-header h2 {
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.page-header .page-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.page-content {
    background-color: var(--surface-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ====================================
   Footer
   ==================================== */

.app-footer {
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    font-size: 12px;
}

/* ====================================
   Common Components
   ==================================== */

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #1565c0;
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    color: white;
}

.btn-success:hover {
    background-color: #2e7d32;
}

.btn-warning {
    background-color: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background-color: #e65100;
}

.btn-danger {
    background-color: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c62828;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--background-color);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-large {
    padding: 12px 28px;
    font-size: 16px;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-group-vertical {
    flex-direction: column;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
}

label .required {
    color: var(--error-color);
    margin-left: 3px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table thead {
    background-color: var(--background-color);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr:hover {
    background-color: #fafafa;
}

.data-table .status-active {
    color: var(--success-color);
    font-weight: 600;
}

.data-table .status-inactive {
    color: var(--error-color);
    font-weight: 600;
}

.data-table .status-pending {
    color: var(--warning-color);
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--surface-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.card-body {
    margin-bottom: 15px;
}

.card-footer {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

/* Alerts & Messages */
.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-success {
    background-color: #e8f5e9;
    border-left: 4px solid var(--success-color);
    color: #1b5e20;
}

.alert-error {
    background-color: #ffebee;
    border-left: 4px solid var(--error-color);
    color: #b71c1c;
}

.alert-warning {
    background-color: #fff3e0;
    border-left: 4px solid var(--warning-color);
    color: #e65100;
}

.alert-info {
    background-color: #e3f2fd;
    border-left: 4px solid var(--secondary-color);
    color: #0d47a1;
}

/* Grid Utilities */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Search & Filter Section */
.search-filter {
    background-color: var(--background-color);
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.search-input {
    position: relative;
}

.search-input input {
    padding-left: 40px;
}

.search-input::before {
    content: '🔍';
    position: absolute;
    left: 12px;
    top: 38px;
    color: var(--text-secondary);
}

/* Badges & Labels */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary {
    background-color: #e3f2fd;
    color: var(--secondary-color);
}

.badge-success {
    background-color: #e8f5e9;
    color: var(--success-color);
}

.badge-warning {
    background-color: #fff3e0;
    color: var(--warning-color);
}

.badge-danger {
    background-color: #ffebee;
    color: var(--error-color);
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-content {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        max-height: 200px;
        overflow-x: auto;
    }

    .main-nav {
        flex-direction: row;
        justify-content: flex-start;
        gap: 30px;
    }

    .nav-section {
        padding: 0 15px;
        margin-bottom: 0;
        white-space: nowrap;
    }

    .app-main {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-header h2 {
        font-size: 20px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-secondary);
}

.font-bold {
    font-weight: 700;
}

.font-small {
    font-size: 12px;
}

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }

.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-flex {
    display: flex;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}