/* CSS Design System for Oslava 60 */

:root {
    /* Color Palette */
    --color-rose: #d66870;
    --color-rose-hover: #c2525a;
    --color-rose-light: #fef0f2;
    --color-sage: #537560;
    --color-sage-light: #edf2ee;
    --color-gold: #c29d4d;
    --color-gold-hover: #a6843b;
    --color-gold-light: #fbf8f0;
    
    --color-dark: #2f3e35;
    --color-text-body: #4a5c51;
    --color-text-muted: #829286;
    
    --color-white: #ffffff;
    --color-bg: #f9f6f3;
    
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    
    --shadow-sm: 0 4px 12px rgba(83, 117, 96, 0.05);
    --shadow-md: 0 12px 24px rgba(214, 104, 112, 0.08);
    --shadow-lg: 0 20px 40px rgba(83, 117, 96, 0.12);
    
    --transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Base resets & styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Floral effects */
.floral-bg-top {
    position: absolute;
    top: -150px;
    right: -150px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(214, 104, 112, 0.12) 0%, rgba(214, 104, 112, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: float-slow 12s ease-in-out infinite alternate;
}

.floral-bg-bottom {
    position: absolute;
    bottom: -150px;
    left: -150px;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(83, 117, 96, 0.08) 0%, rgba(83, 117, 96, 0) 70%);
    z-index: -1;
    pointer-events: none;
    animation: float-slow 15s ease-in-out infinite alternate-reverse;
}

@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.05); }
}

.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    z-index: 1;
}

/* Card components */
.card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    padding: 32px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(214, 104, 112, 0.2);
}

/* Utility styles */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.text-gold { color: var(--color-gold); }
.text-pink { color: var(--color-rose); }

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-dark);
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 8px;
    line-height: 1.2;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.5rem;
}

p.subtitle {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--border-radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background-color: var(--color-rose);
    color: var(--color-white);
    box-shadow: 0 4px 15px rgba(214, 104, 112, 0.3);
}

.btn-primary:hover {
    background-color: var(--color-rose-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(214, 104, 112, 0.4);
}

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

.btn-outline:hover {
    background-color: var(--color-rose-light);
    color: var(--color-rose-hover);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Inputs */
.input-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.input-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-dark);
}

.input-wrapper {
    position: relative;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 46px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-dark);
    background: rgba(255, 255, 255, 0.9);
    border: 1.5px solid rgba(83, 117, 96, 0.2);
    border-radius: var(--border-radius-sm);
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--color-rose);
    box-shadow: 0 0 0 3px rgba(214, 104, 112, 0.15);
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

.input-wrapper input:focus + .input-icon {
    color: var(--color-rose);
}

/* Error messages */
.error-message {
    background-color: #fff0f0;
    border: 1px solid #ffccd0;
    color: #cc0010;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* ==================== LOGIN SECTION ==================== */
#login-screen {
    max-width: 450px;
    margin: 10% auto;
    text-align: center;
}

.flower-icon-wrapper {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--color-rose-light) 0%, var(--color-sage-light) 100%);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--color-rose);
    margin-bottom: 20px;
    border: 2px solid var(--color-white);
    box-shadow: var(--shadow-sm);
}

.login-body {
    margin-top: 24px;
}

.instruction-text {
    font-size: 0.95rem;
    color: var(--color-text-body);
    margin-bottom: 24px;
}

.login-footer {
    margin-top: 32px;
    border-top: 1px solid rgba(83, 117, 96, 0.1);
    padding-top: 20px;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* ==================== HEADERS ==================== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo i {
    font-size: 2.2rem;
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 0.95rem;
}

/* ==================== SELECTION CARD ==================== */
.my-selection-card {
    background: linear-gradient(135deg, #fffcfb 0%, #fff6f6 100%);
    border: 2px solid rgba(214, 104, 112, 0.25);
}

.my-selection-header {
    margin-bottom: 16px;
    border-bottom: 1px dashed rgba(214, 104, 112, 0.2);
    padding-bottom: 16px;
}

.badge-selection {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-rose-light);
    color: var(--color-rose);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.my-selection-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.selected-flower-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selected-flower-title {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-dark);
}

.selected-flower-subtitle {
    font-size: 0.9rem;
    font-style: italic;
    color: var(--color-text-muted);
}

.selected-flower-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-rose);
}

/* ==================== CATALOG & CONTROLS ==================== */
.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.title-area h3 {
    margin-bottom: 4px;
}

.title-area p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.view-toggle {
    background-color: var(--color-sage-light);
    border-radius: var(--border-radius-sm);
    padding: 4px;
    display: flex;
    gap: 4px;
}

.toggle-btn {
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-body);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.toggle-btn.active {
    background-color: var(--color-white);
    color: var(--color-sage);
    box-shadow: var(--shadow-sm);
}

/* Category navigation */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}

.tab-btn {
    background-color: var(--color-white);
    border: 1px solid rgba(83, 117, 96, 0.15);
    color: var(--color-text-body);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.tab-btn:hover {
    border-color: var(--color-rose);
    color: var(--color-rose);
}

.tab-btn.active {
    background-color: var(--color-rose);
    border-color: var(--color-rose);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(214, 104, 112, 0.2);
}

/* ==================== FLOWER CARDS GRID ==================== */
.flowers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.flower-card {
    background-color: var(--color-white);
    border: 1px solid rgba(83, 117, 96, 0.1);
    border-radius: var(--border-radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 280px;
    box-shadow: var(--shadow-sm);
}

.flower-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-rose) 0%, var(--color-gold) 100%);
    opacity: 0;
    transition: var(--transition);
}

.flower-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(214, 104, 112, 0.15);
}

.flower-card:hover::before {
    opacity: 1;
}

.card-category-badge {
    align-self: flex-start;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--color-sage);
    background-color: var(--color-sage-light);
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.flower-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.flower-name-sk {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-dark);
}

.flower-name-lat {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-muted);
    margin-top: -4px;
    margin-bottom: 8px;
}

.flower-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem;
    background-color: #FAF8F6;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(83, 117, 96, 0.05);
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.spec-item i {
    color: var(--color-rose);
}

.flower-note {
    font-size: 0.8rem;
    color: var(--color-text-body);
    font-style: italic;
    border-left: 2px solid var(--color-gold);
    padding-left: 8px;
    margin-top: 4px;
}

.flower-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #FAF8F6;
    padding-top: 16px;
    margin-top: auto;
}

.price-box {
    display: flex;
    flex-direction: column;
}

.price-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.price-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-rose);
}

.flower-card.reserved {
    opacity: 0.65;
    background-color: var(--color-gold-light);
    border-color: rgba(194, 157, 77, 0.2);
}

/* ==================== TABLES ==================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(83, 117, 96, 0.1);
    box-shadow: var(--shadow-sm);
}

.flowers-table, .guests-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    background-color: var(--color-white);
    font-size: 0.9rem;
}

.flowers-table th, .guests-table th {
    background-color: var(--color-sage-light);
    color: var(--color-dark);
    font-weight: 700;
    padding: 14px 18px;
    font-size: 0.85rem;
    border-bottom: 2px solid rgba(83, 117, 96, 0.15);
}

.flowers-table td, .guests-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(83, 117, 96, 0.08);
    color: var(--color-text-body);
}

.flowers-table tbody tr:hover, .guests-table tbody tr:hover {
    background-color: var(--color-gold-light);
}

.flowers-table tr.selected-row {
    background-color: var(--color-rose-light);
}

.flowers-table tr.reserved-row {
    background-color: #f7f9f7;
    opacity: 0.75;
}

/* Status Indicator */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 4px 10px;
    border-radius: 12px;
}

.status-indicator.available {
    background-color: var(--color-sage-light);
    color: var(--color-sage);
}

.status-indicator.reserved {
    background-color: var(--color-rose-light);
    color: var(--color-rose);
}

/* ==================== ADMIN DASHBOARD ==================== */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-pink-soft { background-color: var(--color-rose-light); color: var(--color-rose); }
.bg-green-soft { background-color: var(--color-sage-light); color: var(--color-sage); }
.bg-gold-soft { background-color: var(--color-gold-light); color: var(--color-gold); }
.bg-blue-soft { background-color: #eef7fc; color: #3182ce; }

.stat-data h4 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
}

.stat-data p {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Admin panels & filters */
.admin-panels-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.admin-panel-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid rgba(83, 117, 96, 0.1);
    padding-bottom: 12px;
}

.admin-tab-btn {
    background: transparent;
    border: none;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-muted);
    padding: 10px 16px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.admin-tab-btn:hover {
    color: var(--color-rose);
}

.admin-tab-btn.active {
    color: var(--color-rose);
}

.admin-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -14px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--color-rose);
    border-radius: 2px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.filters-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    border: 1px solid rgba(83, 117, 96, 0.2);
    border-radius: var(--border-radius-sm);
    outline: none;
    transition: var(--transition);
    background-color: var(--color-white);
}

.search-box input:focus {
    border-color: var(--color-rose);
}

.search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.select-box select {
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    border: 1px solid rgba(83, 117, 96, 0.2);
    border-radius: var(--border-radius-sm);
    outline: none;
    cursor: pointer;
    background-color: var(--color-white);
    color: var(--color-text-body);
}

.select-box select:focus {
    border-color: var(--color-rose);
}

/* Admin Table styles */
.admin-table tbody tr.reserved-row {
    background-color: var(--color-rose-light);
    opacity: 1;
}

.admin-table tbody tr.reserved-row td {
    color: var(--color-dark);
}

.admin-table .donor-name-cell {
    font-weight: 700;
    color: var(--color-rose);
}

.code-badge {
    font-family: monospace;
    background-color: var(--color-sage-light);
    color: var(--color-sage);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.9rem;
}

/* ==================== MODALS ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(47, 62, 53, 0.5);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    max-width: 450px;
    width: 90%;
    animation: modalSlide 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes modalSlide {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.modal-body {
    font-size: 0.95rem;
    margin-bottom: 24px;
    background-color: #FAF8F6;
    padding: 16px;
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(83, 117, 96, 0.05);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: var(--color-white);
    border-left: 4px solid var(--color-rose);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 16px 20px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 300px;
    max-width: 400px;
    animation: toastIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards, toastOut 0.3s ease 4.7s forwards;
}

.toast.success {
    border-left-color: var(--color-sage);
    color: var(--color-dark);
}

.toast.error {
    border-left-color: #cc0010;
    color: #cc0010;
}

@keyframes toastIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
    to { transform: translateY(20px) scale(0.9); opacity: 0; }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .header-logo {
        flex-direction: column;
        gap: 8px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    .view-toggle {
        display: none; /* Hide cards/table toggle on mobile, show cards only */
    }
    
    .catalog-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filters-row {
        flex-direction: column;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .my-selection-body {
        flex-direction: column;
        align-items: flex-start;
    }
}
