/* ================================
   CatWish Design System - CSS
   ================================ */

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --color-bg: #FAFAF9;
    --color-surface: #FFFFFF;
    --color-text-primary: #1A1A1A;
    --color-text-secondary: #6B7280;
    --color-accent: #F97316;
    --color-accent-hover: #EA580C;
    --color-success: #10B981;
    --color-error: #EF4444;
    --color-warning: #F59E0B;
    --color-border: #E5E7EB;
    --color-divider: #F3F4F6;
    --color-overlay: rgba(0, 0, 0, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);

    /* Border Radius - More Rounded! */
    --radius-sm: 16px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-xl: 48px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Typography */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
    --color-bg: #0F0F0F;
    --color-surface: #1A1A1A;
    --color-text-primary: #F5F5F5;
    --color-text-secondary: #A0A0A0;
    --color-accent: #FF8C42;
    --color-accent-hover: #FF7A29;
    --color-border: #2A2A2A;
    --color-divider: #252525;
    --color-overlay: rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

body {
    font-family: var(--font-family);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-primary);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* === Container === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* ================================
   LOGIN PAGE
   ================================ */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><text x="20" y="40" font-size="30" opacity="0.05">🐾</text><text x="60" y="75" font-size="25" opacity="0.05">🐾</text></svg>'),
        linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    background-size: 200px 200px, cover;
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: var(--space-lg);
}

.login-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.logo-icon {
    font-size: 2.5rem;
}

.logo-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
}

.login-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 44px;
    padding: 0 var(--space-md);
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.form-textarea {
    height: auto;
    padding: var(--space-md);
    resize: vertical;
    min-height: 80px;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-input::placeholder,
.form-select::placeholder,
.form-textarea::placeholder {
    color: #9CA3AF;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.form-error {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: #FEE2E2;
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    color: var(--color-error);
    font-size: 0.875rem;
}

/* Password Toggle */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: var(--space-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: var(--space-xs);
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.password-toggle:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

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

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

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
}

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

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

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

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 1.25rem;
    background: transparent;
    border: 1px solid transparent;
}

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

.btn-loader {
    font-size: 1.25rem;
}

/* Form Footer */
.form-footer {
    text-align: center;
}

.link-secondary {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.link-secondary:hover {
    color: var(--color-accent);
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin: var(--space-lg) 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--color-border);
}

.divider span {
    padding: 0 var(--space-md);
}

/* Login Footer */
.login-footer {
    margin-top: var(--space-xl);
    text-align: center;
}

.footer-text {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ================================
   APP PAGE
   ================================ */

.app-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        url('data:image/svg+xml;utf8,<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg"><text x="25" y="50" font-size="35" opacity="0.03">🐾</text><text x="70" y="90" font-size="28" opacity="0.03">🐾</text></svg>'),
        linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%);
    background-size: 250px 250px, cover;
}

[data-theme="dark"] .app-page {
    background:
        url('data:image/svg+xml;utf8,<svg width="120" height="120" xmlns="http://www.w3.org/2000/svg"><text x="25" y="50" font-size="35" opacity="0.05" fill="%23FFFFFF">🐾</text><text x="70" y="90" font-size="28" opacity="0.05" fill="%23FFFFFF">🐾</text></svg>'),
        linear-gradient(135deg, #0F0F0F 0%, #1A1A1A 100%);
    background-size: 250px 250px, cover;
}

/* Header */
.app-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) 0;
    box-shadow: var(--shadow-sm);
}

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

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-right .login-link {
    padding: 8px 20px;
    font-size: 0.95rem;
}

.desktop-actions,
.mobile-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.mobile-actions {
    position: relative;
    display: none;
}

.logo-small {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

.logo-small .logo-icon {
    font-size: 1.75rem;
}

.logo-small .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-accent);
    transition: color var(--transition-fast);
}

.logo-small:hover .logo-text {
    color: var(--color-accent-hover);
}

@media (max-width: 640px) {
    .desktop-actions {
        display: none;
    }

    .mobile-actions {
        display: flex;
    }

    .header-right {
        gap: var(--space-sm);
    }

    .mobile-actions .dropdown-menu {
        min-width: 180px;
        right: 0;
    }
}

/* Main Content */
.app-main {
    flex: 1;
    padding: var(--space-2xl) 0;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    gap: var(--space-lg);
}

.page-title-section {
    flex: 1;
}

.page-title {
    margin-bottom: var(--space-sm);
    color: var(--color-text-primary);
}

.page-subtitle {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.list-controls {
    margin-top: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.list-label {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.list-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.list-actions .form-select {
    min-width: 220px;
}

.list-actions .btn {
    padding: 8px 12px;
}

/* Gifts Grid */
.gifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
}

/* Gift Card */
.gift-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gift-card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--color-accent);
}

.gift-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--color-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: transform var(--transition-normal);
    overflow: hidden;
    flex-shrink: 0;
}

.gift-card:hover .gift-card-image {
    transform: scale(1.1) rotate(5deg);
}

.gift-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gift-card-image-placeholder {
    color: var(--color-text-secondary);
}

.gift-card-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex: 1;
}

.gift-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.gift-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
    flex: 1;
}

.gift-card-price {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
    margin-left: var(--space-sm);
}

.gift-card-description {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.gift-card-footer {
    display: flex;
    gap: var(--space-sm);
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-divider);
    margin-top: auto;
}

.gift-card-footer .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 8px 16px;
}

/* Reserved Badge */
.gift-card.reserved {
    opacity: 0.7;
}

.reserved-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 12px;
    background: var(--color-success);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: var(--space-sm);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--space-2xl) var(--space-lg);
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-lg);
}

.empty-title {
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.empty-text {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
}

.profile-wishlists {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.wishlist-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.wishlist-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
}

.wishlist-card-title {
    font-size: 1.125rem;
    margin: 0;
    color: var(--color-text-primary);
}

.wishlist-card-description {
    margin: var(--space-xs) 0 0 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.wishlist-card-stats {
    display: flex;
    gap: var(--space-lg);
    font-size: 0.9rem;
    color: var(--color-text-secondary);
}

.wishlist-card-stats div {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.wishlist-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.wishlist-card-actions .btn {
    flex: 1;
    min-width: 140px;
}

.wishlist-card-empty {
    text-align: center;
    padding: var(--space-lg);
    color: var(--color-text-secondary);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-lg);
}

.owner-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.owner-card-link:hover {
    transform: translateY(-2px);
}

/* ================================
   MODALS
   ================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    animation: fadeIn var(--transition-normal);
}

.modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn var(--transition-normal);
}

[data-theme="dark"] .modal-content {
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-divider);
    color: var(--color-text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

.modal-text {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-lg);
}

.modal-footer {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* Share Link */
.share-link-container {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.share-link-container .form-input {
    flex: 1;
}

.share-link-container .btn {
    white-space: nowrap;
}

/* ================================
   TOAST NOTIFICATIONS
   ================================ */

.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    pointer-events: auto;
    animation: toastSlideIn var(--transition-normal);
}

.toast.removing {
    animation: toastSlideOut var(--transition-normal);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--color-divider);
    color: var(--color-text-primary);
}

/* Toast Types */
.toast.success {
    border-left: 4px solid var(--color-success);
}

.toast.error {
    border-left: 4px solid var(--color-error);
}

.toast.warning {
    border-left: 4px solid var(--color-warning);
}

.toast.info {
    border-left: 4px solid var(--color-accent);
}

/* ================================
   ANIMATIONS
   ================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .gifts-grid {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 100%;
        margin: 0 var(--space-md);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        min-width: 0;
    }
}

/* ================================
   UTILITIES
   ================================ */

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

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

/* ================================
   MORE ANIMATIONS - PLAYFUL!
   ================================ */

/* Bounce animation for buttons */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Wiggle animation for fun elements */
@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Pulse animation for emphasis */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Floating paw animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Glow animation for special elements */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(249, 115, 22, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
    }
}

/* Rotate animation for loading */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Utility classes for animations */
.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.animate-shake {
    animation: shake 0.5s ease-in-out;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-rotate {
    animation: rotate 1s linear infinite;
}

/* ================================
   PAW DECORATIONS - CUTE!
   ================================ */

.paw-decoration {
    position: fixed;
    font-size: 2rem;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: float 6s ease-in-out infinite;
}

.paw-1 {
    top: 10%;
    left: 5%;
    animation-delay: 0s;
    animation-duration: 5s;
}

.paw-2 {
    top: 30%;
    right: 10%;
    animation-delay: 1s;
    animation-duration: 7s;
    transform: rotate(45deg);
}

.paw-3 {
    bottom: 20%;
    left: 15%;
    animation-delay: 2s;
    animation-duration: 6s;
    transform: rotate(-25deg);
}

.paw-4 {
    top: 60%;
    right: 5%;
    animation-delay: 3s;
    animation-duration: 8s;
    transform: rotate(15deg);
}

.paw-5 {
    bottom: 35%;
    left: 80%;
    animation-delay: 4s;
    animation-duration: 9s;
    transform: rotate(-45deg);
}

/* ================================
   LOADING INDICATORS
   ================================ */

.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--color-divider);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
}

.loader-large {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--space-2xl);
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: rotate 0.6s linear infinite;
}

.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: var(--space-md);
}

.page-loading .loader {
    width: 64px;
    height: 64px;
    border-width: 5px;
}

.loading-text {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ================================
   SKELETON LOADERS
   ================================ */

@keyframes skeleton-loading {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-divider) 25%,
        var(--color-border) 50%,
        var(--color-divider) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.gift-card-skeleton {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.gift-card-skeleton .skeleton-image {
    width: 100%;
    height: 200px;
}

.gift-card-skeleton .skeleton-content {
    padding: var(--space-md);
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: var(--space-sm);
}

.skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: var(--space-xs);
}

.skeleton-text-short {
    height: 16px;
    width: 60%;
}

/* ================================
   RIPPLE EFFECT
   ================================ */

.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* ================================
   BREATHING ANIMATION
   ================================ */

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(249, 115, 22, 0.5);
    }
}

.btn-breathe {
    animation: breathe 3s ease-in-out infinite;
}

/* ================================
   IMPROVED BADGES
   ================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.badge-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.badge-available {
    background: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.badge-premium {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.badge-priority-high {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.badge-priority-medium {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
}

.badge-priority-low {
    background: linear-gradient(135deg, #6B7280 0%, #4B5563 100%);
    color: white;
}

/* ================================
   THEME TOGGLE BUTTON
   ================================ */

.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background: var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-normal);
    border: none;
    padding: 0;
}

.theme-toggle:hover {
    background: var(--color-divider);
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .theme-toggle {
    background: var(--color-accent);
}

[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(30px);
    background: var(--color-surface);
}

/* ================================
   PROGRESS BAR
   ================================ */

.wishlist-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.wishlist-progress-icon {
    font-size: 1.5rem;
    animation: wiggle 2s ease-in-out infinite;
}

.wishlist-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--color-divider);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.wishlist-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
}

.wishlist-progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    white-space: nowrap;
}

/* ================================
   QR CODE CONTAINER
   ================================ */

.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background: var(--color-divider);
    border-radius: var(--radius-md);
}

.qr-code {
    padding: var(--space-md);
    background: white;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.qr-code canvas,
.qr-code img {
    display: block;
    max-width: 100%;
    height: auto;
}

.share-buttons {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    justify-content: center;
}

.share-btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.share-btn-telegram {
    background: #0088cc;
    color: white;
}

.share-btn-telegram:hover {
    background: #006699;
    transform: translateY(-2px);
}

.share-btn-whatsapp {
    background: #25D366;
    color: white;
}

.share-btn-whatsapp:hover {
    background: #1DA851;
    transform: translateY(-2px);
}

.share-btn-email {
    background: #EA4335;
    color: white;
}

.share-btn-email:hover {
    background: #C5221F;
    transform: translateY(-2px);
}

/* ================================
   CONFETTI CANVAS
   ================================ */

.confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ================================
   CAT LOADER ANIMATION
   ================================ */

@keyframes cat-wash {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-15deg);
    }
    75% {
        transform: rotate(15deg);
    }
}

.cat-loader {
    font-size: 4rem;
    animation: cat-wash 1.5s ease-in-out infinite;
}

/* ================================
   EMPTY STATE WITH CAT
   ================================ */

.empty-state-cat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    text-align: center;
}

.empty-state-cat-icon {
    font-size: 6rem;
    margin-bottom: var(--space-lg);
    animation: float 3s ease-in-out infinite;
    filter: grayscale(0.3);
}

.empty-state-cat-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: var(--space-sm);
}

.empty-state-cat-text {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 400px;
}

/* ================================
   404 PAGE STYLES
   ================================ */

.error-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
    background:
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><text x="20" y="40" font-size="30" opacity="0.03">🐾</text><text x="60" y="75" font-size="25" opacity="0.03">🐾</text></svg>'),
        linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    background-size: 200px 200px, cover;
}

.error-cat {
    font-size: 8rem;
    margin-bottom: var(--space-lg);
    animation: wiggle 2s ease-in-out infinite;
}

.error-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--space-md);
}

.error-text {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 500px;
    text-align: center;
}

/* ================================
   AVATAR (DiceBear)
   ================================ */

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--color-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-border);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar-large {
    width: 96px;
    height: 96px;
}

.avatar-small {
    width: 32px;
    height: 32px;
}

/* ================================
   PREMIUM THEMES
   ================================ */

[data-theme="pink"] {
    --color-bg: #FDF2F8;
    --color-surface: #FFFFFF;
    --color-accent: #EC4899;
    --color-accent-hover: #DB2777;
}

[data-theme="blue"] {
    --color-bg: #EFF6FF;
    --color-surface: #FFFFFF;
    --color-accent: #3B82F6;
    --color-accent-hover: #2563EB;
}

[data-theme="purple"] {
    --color-bg: #F5F3FF;
    --color-surface: #FFFFFF;
    --color-accent: #8B5CF6;
    --color-accent-hover: #7C3AED;
}

/* ================================
   MOBILE SWIPE INDICATOR
   ================================ */

.swipe-indicator {
    position: absolute;
    top: 50%;
    right: var(--space-md);
    transform: translateY(-50%);
    display: flex;
    gap: var(--space-xs);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.gift-card:active .swipe-indicator {
    opacity: 0.5;
}

.swipe-dot {
    width: 4px;
    height: 4px;
    background: var(--color-text-secondary);
    border-radius: 50%;
}

/* ================================
   PULL TO REFRESH
   ================================ */

.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    padding: var(--space-md);
    background: var(--color-surface);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    transition: transform var(--transition-normal);
    z-index: 100;
}

.pull-to-refresh.active {
    transform: translateX(-50%) translateY(0);
}

.pull-to-refresh-icon {
    animation: rotate 1s linear infinite;
}

/* ================================
   ENHANCED HOVER EFFECTS
   ================================ */

.hover-lift {
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4);
}

.hover-scale {
    transition: transform var(--transition-fast);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ================================
   LANDING PAGE
   ================================ */

.landing-page {
    min-height: 100vh;
    background:
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><text x="20" y="40" font-size="30" opacity="0.04">🐾</text><text x="60" y="75" font-size="25" opacity="0.04">🐾</text></svg>'),
        linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 50%, #FED7AA 100%);
    background-size: 200px 200px, cover;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
    text-align: center;
    padding: var(--space-2xl);
}

.landing-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-lg);
    animation: float 3s ease-in-out infinite;
}

.landing-subtitle {
    font-size: 1.5rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 600px;
}

.landing-cta {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-xl);
    padding: var(--space-2xl);
    max-width: 1200px;
    margin: 0 auto;
}

.landing-feature {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.5);
    text-align: center;
    transition: all var(--transition-normal);
}

.landing-feature:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.landing-feature-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
}

.landing-feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.landing-feature-text {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

/* ================================
   DROPDOWN MENU
   ================================ */

.dropdown-menu {
    position: absolute;
    top: calc(100% + var(--space-sm));
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    pointer-events: none;
}

.dropdown-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    color: var(--color-text-primary);
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color var(--transition-fast);
}

.dropdown-item:hover {
    background: var(--color-divider);
}

.dropdown-item span {
    font-size: 1.1em;
}

.dropdown-divider {
    height: 1px;
    background: var(--color-divider);
    margin: var(--space-xs) 0;
}

/* ================================
   TELEGRAM LINKING
   ================================ */

.telegram-card {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    background: rgba(249, 115, 22, 0.04);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

[data-theme="dark"] .telegram-card {
    background: rgba(255, 255, 255, 0.03);
}

.telegram-status {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.telegram-status-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.telegram-status-title {
    font-weight: 600;
    font-size: 1rem;
}

.telegram-link-info {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    background: rgba(249, 115, 22, 0.05);
}

.telegram-code-chip {
    font-family: "JetBrains Mono", "Fira Code", monospace;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
}

.telegram-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.telegram-hint {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* ================================
   PROFILE PAGE
   ================================ */

.profile-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-lg);
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-divider);
    margin-bottom: var(--space-lg);
}

.profile-info {
    flex: 1;
}

.profile-name {
    margin: 0 0 var(--space-xs) 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-email,
.profile-bio {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin: 0 0 var(--space-xs) 0;
}

.profile-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.profile-about {
    margin-top: var(--space-md);
}

.profile-about h3 {
    margin-bottom: var(--space-sm);
    font-size: 1.125rem;
}

/* Mobile profile optimizations */
@media (max-width: 640px) {
    .profile-card {
        padding: var(--space-md);
    }

    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }

    .profile-actions {
        flex-direction: column;
        width: 100%;
    }

    .profile-actions .btn {
        width: 100%;
    }
}

/* ================================
   TABS NAVIGATION
   ================================ */

.tabs-container {
    margin-bottom: var(--space-xl);
}

.tabs-nav {
    display: flex;
    gap: var(--space-sm);
    border-bottom: 2px solid var(--color-divider);
    margin-bottom: var(--space-xl);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.tabs-nav::-webkit-scrollbar-track {
    background: var(--color-divider);
}

.tabs-nav::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
}

.tab-button {
    position: relative;
    padding: var(--space-md) var(--space-lg);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tab-button:hover {
    color: var(--color-text-primary);
}

.tab-button.active {
    color: var(--color-accent);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    border-radius: 2px 2px 0 0;
}

.tab-button-icon {
    font-size: 1.2em;
}

.tab-button-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-surface);
    background: var(--color-text-secondary);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.tab-button.active .tab-button-badge {
    background: var(--color-accent);
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease-in-out;
}

.tab-content.active {
    display: block;
}

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

/* Mobile tabs optimization */
@media (max-width: 768px) {
    .tab-button {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.875rem;
    }

    .tab-button-icon {
        font-size: 1.1em;
    }
}

/* ================================
   MOBILE OPTIMIZATIONS
   Критические улучшения для мобильных устройств
   ================================ */

/* Мобильные устройства (до 640px) */
@media (max-width: 640px) {
    /* === Container === */
    .container {
        padding: 0 var(--space-md);
    }

    /* === Typography === */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
    h3 { font-size: 1.125rem; }

    /* === Header === */
    .app-header {
        padding: var(--space-md) 0;
    }

    .header-content {
        padding: 0;
    }

    .logo-small {
        font-size: 1.125rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    /* === Main Content === */
    .app-main {
        padding: var(--space-lg) 0;
    }

    /* === Page Header === */
    .page-header {
        flex-direction: column;
        gap: var(--space-md);
        margin-bottom: var(--space-lg);
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.875rem;
    }

    /* === Buttons === */
    .btn {
        min-height: 48px; /* Минимум 48px для удобного нажатия */
        padding: 12px 20px;
        font-size: 0.9375rem;
    }

    .btn-icon {
        min-width: 48px;
        min-height: 48px;
        padding: 12px;
    }

    .btn-text {
        display: inline; /* Показываем текст на кнопках */
    }

    /* Убираем иконки на критичных кнопках для лучшей читаемости */
    .page-header .btn .btn-icon {
        display: none;
    }

    /* === Модальные окна === */
    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh; /* Полный экран на мобильных */
        margin: 0;
        border-radius: 0; /* Без скругления на весь экран */
        padding: 0;
    }

    .modal-small .modal-content {
        min-height: auto;
        max-height: 90vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
    }

    .modal-header {
        padding: var(--space-lg);
        position: sticky;
        top: 0;
        background: var(--color-surface);
        z-index: 10;
        border-bottom: 1px solid var(--color-border);
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-body {
        padding: var(--space-lg);
        max-height: calc(90vh - 180px);
        overflow-y: auto;
    }

    .modal-footer {
        padding: var(--space-lg);
        flex-direction: column-reverse;
        gap: var(--space-sm);
        position: sticky;
        bottom: 0;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
    }

    .modal-footer .btn {
        width: 100%;
    }

    /* === Формы === */
    .form-input,
    .form-textarea {
        min-height: 48px;
        font-size: 16px; /* Предотвращает зум на iOS */
        padding: 12px 16px;
    }

    .form-textarea {
        min-height: 120px;
    }

    .form-label {
        font-size: 0.9375rem;
        font-weight: 600;
    }

    /* === Карточки подарков === */
    .gifts-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .gift-card {
        padding: var(--space-md);
    }

    .gift-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .gift-card-image {
        height: 200px;
    }

    .gift-card-title {
        font-size: 1.125rem;
    }

    .gift-card-price {
        font-size: 1rem;
    }

    .gift-card-description {
        font-size: 0.875rem;
        -webkit-line-clamp: 3;
    }

    .gift-card-footer {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .gift-card-footer .btn {
        width: 100%;
    }

    /* === Wishlist Cards === */
    .wishlist-card {
        padding: var(--space-md);
    }

    .wishlist-card-title {
        font-size: 1.125rem;
    }

    .wishlist-card-description {
        font-size: 0.875rem;
    }

    .wishlist-card-actions {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .wishlist-card-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* === Dropdown Menu === */
    .dropdown-menu {
        min-width: 200px;
        max-width: calc(100vw - 32px);
    }

    .dropdown-item {
        min-height: 48px;
        padding: 12px 16px;
        font-size: 0.9375rem;
    }

    /* === Toast === */
    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
        bottom: var(--space-md);
    }

    .toast {
        min-width: 0;
        padding: 12px 16px;
        font-size: 0.9375rem;
    }

    /* === Empty State === */
    .empty-state {
        padding: var(--space-xl) var(--space-md);
    }

    .empty-icon {
        font-size: 3.5rem;
    }

    .empty-title {
        font-size: 1.25rem;
    }

    .empty-text {
        font-size: 0.9375rem;
    }

    /* === Share Modal === */
    .qr-container {
        padding: var(--space-md);
    }

    .qr-code {
        width: 200px !important;
        height: 200px !important;
    }

    .share-link-container {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .share-link-container .btn {
        width: 100%;
    }

    .share-buttons {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .share-btn {
        width: 100%;
        padding: 14px 20px;
    }

    /* === Badge === */
    .badge {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    /* === Profile === */
    .profile-header {
        flex-direction: column;
        text-align: center;
        gap: var(--space-md);
    }

    .avatar {
        width: 80px;
        height: 80px;
    }

    .profile-actions {
        flex-direction: column;
        width: 100%;
    }

    .profile-actions .btn {
        width: 100%;
    }

    /* === Settings === */
    .settings-section {
        padding: var(--space-md);
    }

    /* === Loader === */
    .loader-overlay {
        padding: var(--space-md);
    }

    /* === Pagination === */
    .pagination {
        flex-wrap: wrap;
        gap: var(--space-xs);
    }

    .pagination .btn {
        min-width: 44px;
        padding: 10px;
    }
}

/* Очень маленькие экраны (до 375px) */
@media (max-width: 375px) {
    /* Еще более компактные элементы */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .container {
        padding: 0 var(--space-sm);
    }

    .btn {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    .modal-content {
        padding: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--space-md);
    }

    .gift-card,
    .wishlist-card {
        padding: var(--space-sm);
    }

    .gift-card-image {
        height: 180px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 896px) and (max-height: 420px) and (orientation: landscape) {
    .modal-content {
        max-height: 100vh;
        overflow-y: auto;
    }

    .modal-body {
        max-height: calc(100vh - 160px);
    }

    .app-header {
        padding: var(--space-sm) 0;
    }

    .app-main {
        padding: var(--space-md) 0;
    }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем интерактивные элементы для touch */
    button,
    .btn,
    a {
        min-height: 44px; /* Рекомендация Apple для touch targets */
    }

    /* Убираем hover эффекты на touch устройствах */
    .btn:hover,
    .gift-card:hover,
    .wishlist-card:hover {
        transform: none;
    }

    /* Добавляем активное состояние для touch */
    .btn:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    /* Улучшаем видимость фокуса */
    input:focus,
    textarea:focus,
    select:focus {
        outline: 2px solid var(--color-accent);
        outline-offset: 2px;
    }
}

/* ================================
   MOBILE FIX: Prevent horizontal scroll
   ================================ */
@media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    * {
        max-width: 100%;
    }

    img {
        max-width: 100%;
        height: auto;
    }
}

/* ================================
   MOBILE FIX: Safe area insets (для iPhone X и новее)
   ================================ */
@supports (padding: max(0px)) {
    @media (max-width: 640px) {
        .app-header {
            padding-left: max(var(--space-lg), env(safe-area-inset-left));
            padding-right: max(var(--space-lg), env(safe-area-inset-right));
            padding-top: max(var(--space-md), env(safe-area-inset-top));
        }

        .app-main {
            padding-bottom: max(var(--space-2xl), env(safe-area-inset-bottom));
        }

        .modal-content {
            padding-bottom: max(0px, env(safe-area-inset-bottom));
        }
    }
}
