/* Goodminton Tailwind CDN-Compatible Styles */
/* No @apply directives - plain CSS only */

:root {
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --amber-100: #fef3c7;
    --amber-400: #fbbf24;
    --amber-700: #b45309;
    --rose-100: #ffe4e6;
    --rose-400: #fb7185;
    --rose-700: #be123c;
    --sky-100: #e0f2fe;
    --sky-400: #38bdf8;
    --sky-700: #0369a1;
    --violet-100: #ede9fe;
    --violet-500: #8b5cf6;
    --violet-700: #6d28d9;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
}

body {
    font-family: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #ecfdf5 0%, #fefce8 50%, #f0f9ff 100%);
    min-height: 100vh;
}

/* ===== CARD ===== */
.gm-card {
    background: white;
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.gm-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 700;
    color: var(--gray-800);
}

/* ===== BUTTONS ===== */
.gm-btn-primary,
.gm-btn-secondary,
.gm-btn-warning,
.gm-btn-danger,
.gm-btn-info {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    gap: 0.25rem;
}
.gm-btn-primary:hover,
.gm-btn-secondary:hover,
.gm-btn-warning:hover,
.gm-btn-danger:hover,
.gm-btn-info:hover { transform: scale(1.03); }
.gm-btn-primary:active,
.gm-btn-secondary:active,
.gm-btn-warning:active,
.gm-btn-danger:active,
.gm-btn-info:active { transform: scale(0.97); }

.gm-btn-primary {
    background: linear-gradient(to right, #10b981, #14b8a6) !important;
    color: white !important;
}
.gm-btn-secondary {
    background: white !important;
    color: var(--gray-700) !important;
    border: 2px solid var(--gray-200);
}
.gm-btn-warning {
    background: linear-gradient(to right, #fbbf24, #fb923c) !important;
    color: white !important;
}
.gm-btn-danger {
    background: linear-gradient(to right, #fb7185, #ef4444) !important;
    color: white !important;
}
.gm-btn-info {
    background: linear-gradient(to right, #38bdf8, #3b82f6) !important;
    color: white !important;
}

.gm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    text-decoration: none;
    white-space: nowrap;
    gap: 0.25rem;
}
.gm-btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.5rem; line-height: 1rem; }

/* ===== STAT CARD ===== */
.gm-stat-card {
    border-radius: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    color: white;
    position: relative;
    overflow: hidden;
}
.gm-stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
}
.gm-stat-card h3 { font-weight: 800; line-height: 1.2; margin: 0; }
.gm-stat-card p { font-weight: 600; opacity: 0.9; margin: 0 0 0.25rem 0; }

/* ===== FORM ===== */
/* --- Base Input --- */
.gm-input {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s ease;
}
.gm-input:focus {
    border-color: #34d399;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.gm-input::placeholder { color: var(--gray-400); }
.gm-input:disabled {
    background: var(--gray-50);
    cursor: not-allowed;
    opacity: 0.7;
}
.gm-input[readonly] {
    background: var(--gray-50);
    cursor: default;
}

/* --- Input Sizes --- */
.gm-input-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.5rem; line-height: 1rem; }
.gm-input-lg { padding: 0.75rem 1.25rem; font-size: 1rem; border-radius: 1rem; }

/* --- Input with Icon (wrapper) --- */
.gm-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.gm-input-wrapper .gm-input {
    padding-left: 2.5rem;
}
.gm-input-wrapper .gm-input-icon {
    position: absolute;
    left: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-400);
    pointer-events: none;
    flex-shrink: 0;
}
.gm-input-wrapper .gm-input-icon-right {
    position: absolute;
    right: 0.75rem;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-400);
    pointer-events: none;
}
.gm-input-wrapper .gm-input--with-right { padding-right: 2.5rem; }

/* --- Select --- */
.gm-select {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    padding-left: 1rem;
    border-radius: 0.75rem;
    border: 2px solid var(--gray-200);
    background-color: white;
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition: all 0.2s ease;
    width: 100%;
}
.gm-select:focus {
    border-color: #34d399;
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}
.gm-select:hover {
    border-color: var(--gray-300);
}
.gm-select:disabled {
    background-color: var(--gray-50);
    cursor: not-allowed;
    opacity: 0.7;
}

/* --- Select Sizes --- */
.gm-select-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 0.5rem; line-height: 1rem; background-position: right 0.5rem center; padding-right: 1.75rem; }

/* --- Label --- */
.gm-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 0.375rem;
    letter-spacing: 0.02em;
}

/* --- Textarea --- */
textarea.gm-input { min-height: 2.5rem; resize: vertical; }

/* --- Form Helper Text --- */
.gm-form-text {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.25rem;
    line-height: 1.25;
}

.gm-form-error {
    display: block;
    font-size: 0.75rem;
    color: var(--rose-700);
    margin-top: 0.25rem;
    line-height: 1.25;
}

/* --- Input Error State --- */
.gm-input-error {
    border-color: var(--rose-400) !important;
}
.gm-input-error:focus {
    box-shadow: 0 0 0 3px rgba(251, 113, 133, 0.15) !important;
}

/* ===== RADIO & CHECKBOX (custom) ===== */
/* Hide native control, style label instead */
.gm-radio,
.gm-checkbox {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.gm-radio + .gm-radio-label,
.gm-checkbox + .gm-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.25rem;
    user-select: none;
    padding: 0.25rem 0;
    transition: color 0.15s ease;
}
.gm-radio + .gm-radio-label:hover,
.gm-checkbox + .gm-checkbox-label:hover {
    color: var(--gray-800);
}

/* Radio circle */
.gm-radio + .gm-radio-label::before {
    content: '';
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    border: 2px solid var(--gray-300);
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.gm-radio:checked + .gm-radio-label::before {
    border-color: var(--emerald-500);
    background: var(--emerald-500);
    box-shadow: inset 0 0 0 3px white, 0 0 0 1px var(--emerald-500);
}
.gm-radio:focus + .gm-radio-label::before {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.gm-radio:disabled + .gm-radio-label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Checkbox square */
.gm-checkbox + .gm-checkbox-label::before {
    content: '';
    display: inline-flex;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.375rem;
    border: 2px solid var(--gray-300);
    background: white;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.gm-checkbox:checked + .gm-checkbox-label::before {
    border-color: var(--emerald-500);
    background: var(--emerald-500) url("data:image/svg+xml,%3Csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3E%3C/svg%3E") center/70% no-repeat;
}
.gm-checkbox:focus + .gm-checkbox-label::before {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.gm-checkbox:disabled + .gm-checkbox-label {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Inline radio/checkbox group */
.gm-fieldset-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    padding: 0.25rem 0;
}

/* ===== FORM SECTION ===== */
.gm-form-section {
    margin-bottom: 1.5rem;
}
.gm-form-section:last-child {
    margin-bottom: 0;
}
.gm-form-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}
.gm-form-footer {
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
    margin-top: 1rem;
}

/* ===== TABLE ===== */
.gm-table {
    width: 100%;
    text-align: left;
    border-collapse: collapse;
}

.gm-table thead th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--emerald-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--emerald-50);
    border-bottom: 2px solid var(--emerald-100);
}

.gm-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
    color: var(--gray-700);
}

.gm-table tbody tr:hover {
    background: #fefce8;
}

/* ===== BADGE ===== */
.gm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.25rem;
}
.gm-badge-success { background: var(--emerald-100); color: var(--emerald-700); }
.gm-badge-warning { background: var(--amber-100); color: var(--amber-700); }
.gm-badge-danger { background: var(--rose-100); color: var(--rose-700); }
.gm-badge-info { background: var(--sky-100); color: var(--sky-700); }
.gm-badge-purple { background: var(--violet-100); color: var(--violet-700); }
.gm-badge-gray { background: var(--gray-100); color: var(--gray-700); }

/* ===== NAVBAR ===== */
.gm-navbar {
    background: linear-gradient(135deg, #10b981 0%, #14b8a6 50%, #0ea5e9 100%) !important;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25);
}

/* ===== LOGIN ===== */
.gm-login-bg {
    background: linear-gradient(135deg, #10b981 0%, #f59e0b 50%, #ec4899 100%);
}

/* ===== ANIMATIONS ===== */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}
.gm-float { animation: float 3s ease-in-out infinite; }

/* ===== PRINT ===== */
@media print {
    .gm-navbar, .gm-btn, .btn-delete-draw, footer, select { display: none !important; }
    .gm-card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
    body { background: white !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .gm-card { border-radius: 1rem; }
    .gm-card-header { padding: 0.75rem 1rem; }
    .gm-stat-card { padding: 1rem; }
    .gm-stat-card h3 { font-size: 1.5rem; }
    .gm-table thead th { padding: 0.5rem 0.75rem; font-size: 0.625rem; }
    .gm-table tbody td { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
    .gm-btn { padding: 0.5rem 0.75rem; font-size: 0.75rem; min-height: 2.25rem; }
    .gm-btn-sm { padding: 0.35rem 0.6rem; font-size: 0.625rem; min-height: 1.75rem; }
    .gm-select { padding-top: 0.5rem; padding-bottom: 0.5rem; font-size: 0.8rem; min-height: 2.5rem; }
    .gm-input { padding: 0.5rem 0.75rem; font-size: 0.8rem; min-height: 2.5rem; }
    .gm-label { font-size: 0.7rem; margin-bottom: 0.25rem; }
    .gm-badge { font-size: 0.65rem; padding: 0.1rem 0.5rem; }
}

@media (max-width: 380px) {
    .gm-card-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .gm-stat-card h3 { font-size: 1.25rem; }
}
