/**
 * Žluté Stránky - Kruhy (Circles) CSS
 * 
 * Styling for the circles page - both guest and logged-in views.
 * 
 * @package ZluteStranky
 * @subpackage Frontend
 */

/* ==========================================
   GUEST VIEW - HERO SECTION
   ========================================== */
.kruhy-hero {
    position: relative;
    padding: calc(var(--header-height, 72px) + 4rem) 0 5rem;
    background: linear-gradient(135deg, var(--color-black, #1a1a1a) 0%, #2d2d2d 100%);
    overflow: hidden;
}

.kruhy-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

.kruhy-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, #3B82F6 0%, transparent 60%);
    opacity: 0.15;
    pointer-events: none;
}

.kruhy-hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.kruhy-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: var(--radius-full, 50px);
    color: #60A5FA;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.kruhy-hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.kruhy-hero-title .highlight {
    color: var(--color-yellow, #FFD900);
}

.kruhy-hero-desc {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Recognized User CTA */
.kruhy-recognized-user {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 217, 0, 0.15) 0%, rgba(255, 217, 0, 0.05) 100%);
    border: 1px solid rgba(255, 217, 0, 0.3);
    border-radius: var(--radius-xl, 16px);
    margin-bottom: 2rem;
}

.recognized-greeting {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.recognized-icon {
    font-size: 2rem;
}

.recognized-text strong {
    display: block;
    color: white;
    font-size: 1.125rem;
}

.recognized-text p {
    color: rgba(255, 255, 255, 0.8);
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
}

/* Standard CTA */
.kruhy-hero-cta {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.kruhy-hero-stats {
    display: flex;
    gap: 3rem;
}

.hero-stat {
    text-align: left;
}

.hero-stat .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--color-yellow, #FFD900);
}

.hero-stat .stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* Circles Demo Visual */
.kruhy-hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.circles-demo {
    position: relative;
    width: 400px;
    height: 400px;
}

.demo-circle {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.demo-circle:hover {
    transform: scale(1.1);
}

.demo-circle.demo-home {
    top: 50px;
    left: 50px;
    background: linear-gradient(135deg, #FF9500, #FF7A00);
    animation-delay: 0s;
}

.demo-circle.demo-work {
    top: 50px;
    right: 50px;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    animation-delay: 0.5s;
}

.demo-circle.demo-vacation {
    bottom: 50px;
    left: 50px;
    background: linear-gradient(135deg, #10B981, #059669);
    animation-delay: 1s;
}

.demo-circle.demo-family {
    bottom: 50px;
    right: 50px;
    background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    animation-delay: 1.5s;
}

.demo-icon {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.demo-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
}

.demo-user {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-yellow, #FFD900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 0 0 4px rgba(255, 217, 0, 0.3), 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ==========================================
   BENEFITS SECTION
   ========================================== */
.kruhy-benefits {
    padding: 5rem 0;
    background: var(--color-gray-50, #f9fafb);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    text-align: center;
    color: var(--color-gray-600, #6b7280);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.benefit-card {
    background: white;
    border-radius: var(--radius-xl, 16px);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0,0,0,0.08));
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.15));
}

.benefit-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.benefit-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.benefit-card p {
    color: var(--color-gray-600, #6b7280);
    line-height: 1.6;
}

/* ==========================================
   HOW IT WORKS SECTION
   ========================================== */
.kruhy-how-it-works {
    padding: 5rem 0;
    background: white;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.step-card {
    position: relative;
    background: var(--color-gray-50, #f9fafb);
    border-radius: var(--radius-xl, 16px);
    padding: 2rem;
}

.step-number {
    position: absolute;
    top: -1rem;
    left: 2rem;
    width: 3rem;
    height: 3rem;
    background: var(--color-yellow, #FFD900);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--color-black, #1a1a1a);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
}

.step-content {
    padding-top: 1rem;
}

.step-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.step-content p {
    color: var(--color-gray-600, #6b7280);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.step-visual {
    background: white;
    border-radius: var(--radius-lg, 12px);
    padding: 1.5rem;
    border: 1px solid var(--color-gray-200, #e5e7eb);
}

.mini-map {
    position: relative;
    height: 80px;
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    border-radius: var(--radius-md, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-pin {
    font-size: 1.5rem;
    z-index: 2;
}

.mini-radius {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px dashed #3B82F6;
    border-radius: 50%;
    opacity: 0.6;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 0.3; }
}

.mini-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    background: var(--color-gray-50, #f9fafb);
    border-radius: var(--radius-md, 8px);
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.dropdown-item.active {
    background: var(--color-yellow-light, #FFF8E1);
    border-left: 3px solid var(--color-yellow, #FFD900);
    font-weight: 600;
}

.mini-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mini-business {
    padding: 0.5rem 0.75rem;
    background: var(--color-gray-50, #f9fafb);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.8125rem;
}

/* ==========================================
   GAMIFICATION SECTION
   ========================================== */
.kruhy-gamification {
    padding: 5rem 0;
    background: linear-gradient(135deg, var(--color-black, #1a1a1a) 0%, #2d2d2d 100%);
}

.gamification-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.gamification-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full, 50px);
    color: #A78BFA;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.gamification-text h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.gamification-text p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.xp-rewards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.xp-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg, 12px);
}

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

.xp-text {
    flex: 1;
    color: white;
    font-weight: 500;
}

.xp-value {
    color: var(--color-success, #10B981);
    font-weight: 700;
}

.streak-reminder {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 217, 0, 0.15);
    border: 1px solid rgba(255, 217, 0, 0.3);
    border-radius: var(--radius-lg, 12px);
    margin-top: 1.5rem;
    color: white;
}

.streak-fire {
    font-size: 1.5rem;
    animation: fire 0.5s ease-in-out infinite alternate;
}

@keyframes fire {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

/* Level Card Visual */
.level-card {
    background: white;
    border-radius: var(--radius-xl, 16px);
    padding: 2rem;
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.15));
}

.level-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.level-icon {
    font-size: 2rem;
}

.level-name {
    font-size: 1.25rem;
    font-weight: 700;
}

.level-progress {
    margin-bottom: 1.5rem;
}

.level-bar {
    height: 12px;
    background: var(--color-gray-200, #e5e7eb);
    border-radius: var(--radius-full, 50px);
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-yellow, #FFD900), #F59E0B);
    border-radius: var(--radius-full, 50px);
    transition: width 1s ease;
}

.level-xp {
    font-size: 0.875rem;
    color: var(--color-gray-600, #6b7280);
}

.level-badges {
    display: flex;
    gap: 0.75rem;
}

.level-badges .badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-gray-100, #f3f4f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.level-badges .badge.earned {
    background: var(--color-yellow-light, #FFF8E1);
}

.level-badges .badge.locked {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* ==========================================
   FINAL CTA SECTION
   ========================================== */
.kruhy-final-cta {
    padding: 5rem 0;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
}

.cta-content > p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

.cta-recognized {
    max-width: 500px;
    margin: 0 auto;
}

.cta-welcome {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
}

.cta-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.cta-divider {
    color: rgba(255, 255, 255, 0.6);
}

.cta-note {
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
}

/* ==========================================
   LOGGED-IN VIEW - DASHBOARD
   ========================================== */
.kruhy-dashboard-header {
    padding: calc(var(--header-height, 72px) + 2rem) 0 2rem;
    background: linear-gradient(135deg, var(--color-black, #1a1a1a) 0%, #2d2d2d 100%);
}

.dashboard-header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header-text h1 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.25rem;
}

.dashboard-header-text p {
    color: rgba(255, 255, 255, 0.7);
}

.circles-stats-bar {
    display: flex;
    gap: 2rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-xl, 16px);
}

.circle-stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.circle-stat-item .stat-icon {
    font-size: 1.5rem;
}

.circle-stat-item .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
}

.circle-stat-item .stat-label {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

/* ==========================================
   CIRCLES GRID
   ========================================== */
.kruhy-grid-section {
    padding: 1rem 0;
    background: var(--color-gray-50, #f9fafb);
}

.circles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.circle-card {
    background: white;
    border-radius: var(--radius-xl, 16px);
    padding: 1.5rem;
    box-shadow: var(--shadow-card, 0 4px 12px rgba(0,0,0,0.08));
    border-left: 4px solid var(--circle-color, #3B82F6);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.circle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.15));
}

.circle-card-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.circle-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg, 12px);
    background: linear-gradient(135deg, var(--circle-color, #3B82F6), color-mix(in srgb, var(--circle-color, #3B82F6) 80%, black));
    display: flex;
    align-items: center;
    justify-content: center;
}

.circle-emoji {
    font-size: 1.75rem;
}

.circle-info {
    flex: 1;
}

.circle-name {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.circle-location {
    font-size: 0.875rem;
    color: var(--color-gray-600, #6b7280);
    margin-bottom: 0.25rem;
}

.circle-radius {
    font-size: 0.75rem;
    color: var(--color-gray-500, #9ca3af);
}

.circle-menu {
    position: relative;
}

.circle-menu-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--color-gray-100, #f3f4f6);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    font-size: 1.25rem;
    transition: background 0.2s ease;
}

.circle-menu-btn:hover {
    background: var(--color-gray-200, #e5e7eb);
}

.circle-menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,0.15));
    min-width: 180px;
    padding: 0.5rem;
    display: none;
    z-index: 100;
}

.circle-menu-dropdown.active {
    display: block;
}

/* Menu items are <button> now, not <a href="#"> — "Smazat" is an action, not a
   link, and href="#" gave keyboard users a destination that goes nowhere.
   Selector updated to match; the `a` variants are kept so any cached/older
   markup still renders correctly during rollout. */
.circle-menu-dropdown a,
.circle-menu-dropdown button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    color: var(--color-gray-700, #374151);
    border-radius: var(--radius-md, 8px);
    transition: background 0.2s ease;
    /* button reset */
    background: none;
    border: 0;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.circle-menu-dropdown a:hover,
.circle-menu-dropdown button:hover {
    background: var(--color-gray-100, #f3f4f6);
}

.circle-menu-dropdown a:focus-visible,
.circle-menu-dropdown button:focus-visible {
    outline: 2px solid var(--color-primary, #FFD900);
    outline-offset: -2px;
}

.circle-menu-dropdown a.danger,
.circle-menu-dropdown button.danger {
    color: var(--color-error, #EF4444);
}

.circle-menu-dropdown a.danger:hover,
.circle-menu-dropdown button.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.circle-new-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--color-success-light, #D1FAE5);
    color: var(--color-success, #059669);
    border-radius: var(--radius-full, 50px);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.circle-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--color-gray-50, #f9fafb);
    border-radius: var(--radius-lg, 12px);
}

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

.circle-stat .value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-black, #1a1a1a);
}

.circle-stat .label {
    font-size: 0.6875rem;
    color: var(--color-gray-500, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.circle-categories {
    margin-bottom: 1rem;
}

.categories-label {
    font-size: 0.75rem;
    color: var(--color-gray-500, #9ca3af);
    margin-bottom: 0.5rem;
    display: block;
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.category-tag {
    padding: 0.25rem 0.5rem;
    background: var(--color-gray-100, #f3f4f6);
    border-radius: var(--radius-sm, 6px);
    font-size: 0.75rem;
    color: var(--color-gray-600, #6b7280);
}

.circle-actions {
    display: flex;
    gap: 0.75rem;
}

.circle-actions .btn {
    flex: 1;
}

/* Add Circle Card */
.circle-card-add {
    border: 2px dashed var(--color-gray-300, #d1d5db);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.circle-card-add:hover {
    border-color: var(--color-yellow, #FFD900);
    background: rgba(255, 217, 0, 0.05);
}

.add-circle-content {
    text-align: center;
}

.add-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--color-gray-400, #a1a1aa);
}

.circle-card-add:hover .add-icon {
    color: var(--color-yellow, #FFD900);
}

.add-circle-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.add-circle-content p {
    color: var(--color-gray-500, #9ca3af);
    font-size: 0.875rem;
}

/* ==========================================
   EMPTY STATE
   ========================================== */
.kruhy-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.kruhy-empty-state h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.kruhy-empty-state > p {
    color: var(--color-gray-600, #6b7280);
    font-size: 1.125rem;
    margin-bottom: 2rem;
}

.empty-state-tips {
    max-width: 400px;
    margin: 3rem auto 0;
    padding: 1.5rem;
    background: var(--color-yellow-light, #FFF8E1);
    border-radius: var(--radius-xl, 16px);
    text-align: left;
}

.empty-state-tips h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.empty-state-tips ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.empty-state-tips li {
    font-size: 0.9375rem;
}

/* ==========================================
   TIPS SECTION
   ========================================== */
.kruhy-tips-section {
    padding: 2rem 0 3rem;
    background: var(--color-gray-50, #f9fafb);
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.tip-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem;
    background: white;
    border-radius: var(--radius-lg, 12px);
    box-shadow: var(--shadow-sm, 0 2px 6px rgba(0,0,0,0.05));
}

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

.tip-card h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tip-card p {
    font-size: 0.8125rem;
    color: var(--color-gray-600, #6b7280);
}

/* ==========================================
   CREATE CIRCLE MODAL
   ========================================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-xl, 16px);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl, 0 20px 50px rgba(0,0,0,0.25));
}

.modal-lg {
    max-width: 700px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--color-gray-200, #e5e7eb);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--color-gray-100, #f3f4f6);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    font-size: 1.125rem;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: var(--color-gray-200, #e5e7eb);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    border-top: 1px solid var(--color-gray-200, #e5e7eb);
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-gray-300, #d1d5db);
    border-radius: var(--radius-md, 8px);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-yellow, #FFD900);
    box-shadow: 0 0 0 3px rgba(255, 217, 0, 0.2);
}

.address-input-wrapper {
    display: flex;
    gap: 0.75rem;
}

.address-input-wrapper .form-input {
    flex: 1;
}

.btn-gps {
    padding: 0 1rem;
    background: var(--color-gray-100, #f3f4f6);
    border: 1px solid var(--color-gray-300, #d1d5db);
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    font-size: 0.875rem;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.btn-gps:hover {
    background: var(--color-gray-200, #e5e7eb);
}

/* Icon Picker */
.icon-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.icon-option {
    width: 44px;
    height: 44px;
    border: 2px solid var(--color-gray-200, #e5e7eb);
    background: white;
    border-radius: var(--radius-md, 8px);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.2s ease;
}

.icon-option:hover {
    border-color: var(--color-gray-400, #a1a1aa);
}

.icon-option.selected {
    border-color: var(--color-yellow, #FFD900);
    background: var(--color-yellow-light, #FFF8E1);
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 0.5rem;
}

.color-option {
    width: 36px;
    height: 36px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: var(--color-black, #1a1a1a);
    box-shadow: 0 0 0 2px white, 0 0 0 4px var(--color-black, #1a1a1a);
}

/* Radius Slider */
.radius-slider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.radius-slider input[type="range"] {
    flex: 1;
    height: 8px;
    -webkit-appearance: none;
    background: var(--color-gray-200, #e5e7eb);
    border-radius: var(--radius-full, 50px);
}

.radius-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: var(--color-yellow, #FFD900);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.15));
}

.radius-value {
    min-width: 60px;
    font-weight: 700;
}

.radius-presets {
    display: flex;
    gap: 0.5rem;
}

.radius-presets button {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--color-gray-300, #d1d5db);
    background: white;
    border-radius: var(--radius-sm, 6px);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.radius-presets button:hover {
    background: var(--color-gray-100, #f3f4f6);
}

.radius-presets button.active {
    background: var(--color-yellow, #FFD900);
    border-color: var(--color-yellow, #FFD900);
    font-weight: 600;
}

/* ==========================================
   LOCATION SECTION & GPS
   ========================================== */
.location-section {
    background: var(--color-gray-50, #f9fafb);
    border-radius: var(--radius-xl, 16px);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.location-input-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.address-field {
    flex: 1;
    position: relative;
}

.address-field .form-input {
    padding-left: 2.75rem;
    padding-right: 1rem;
}

.address-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.125rem;
    opacity: 0.5;
}

.location-hint {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-gray-500, #9ca3af);
    padding-left: 0.25rem;
}

/* Search Address Button */
.btn-search-address {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--color-yellow, #FFD900) 0%, #F59E0B 100%);
    border: none;
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-black, #1a1a1a);
    white-space: nowrap;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(255, 217, 0, 0.3);
}

.btn-search-address:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 217, 0, 0.4);
}

.btn-search-address:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.search-icon {
    font-size: 1.125rem;
}

.search-loading {
    display: inline-flex;
    align-items: center;
}

/* OR Divider */
.location-divider {
    display: flex;
    align-items: center;
    margin: 1rem 0;
    gap: 1rem;
}

.location-divider::before,
.location-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-gray-300, #d1d5db);
}

.location-divider span {
    font-size: 0.8125rem;
    color: var(--color-gray-500, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* GPS My Location Button - Full Width */
.btn-gps-location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: white;
    border: 2px solid var(--color-gray-300, #d1d5db);
    border-radius: var(--radius-lg, 12px);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-gray-700, #374151);
    transition: all 0.3s ease;
}

.btn-gps-location:hover:not(:disabled) {
    border-color: var(--color-yellow, #FFD900);
    background: var(--color-yellow-light, #FFF8E1);
    color: var(--color-black, #1a1a1a);
}

.btn-gps-location:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-gps-location.loading {
    background: var(--color-gray-100, #f3f4f6);
    border-color: var(--color-gray-300, #d1d5db);
}

.gps-icon {
    font-size: 1.25rem;
}

.gps-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: var(--color-black, #1a1a1a);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Animated Hint Arrow - Points UP to search button */
.gps-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(255, 217, 0, 0.2) 0%, rgba(245, 158, 11, 0.15) 100%);
    border: 2px dashed var(--color-yellow, #FFD900);
    border-radius: var(--radius-lg, 12px);
    animation: hint-pulse 1.5s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { 
        transform: scale(1);
        border-color: var(--color-yellow, #FFD900);
    }
    50% { 
        transform: scale(1.02);
        border-color: #F59E0B;
    }
}

.hint-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: arrow-point-up 0.8s ease-in-out infinite;
}

@keyframes arrow-point-up {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.arrow-icon {
    font-size: 2rem;
}

.hint-text {
    flex: 1;
    font-size: 0.875rem;
    color: var(--color-gray-700, #374151);
    line-height: 1.4;
}

.hint-text strong {
    color: var(--color-black, #1a1a1a);
}

/* Coordinates Display Badge */
.coordinates-display {
    margin-top: 1rem;
}

.coord-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 1px solid #6EE7B7;
    border-radius: var(--radius-full, 50px);
    animation: badge-appear 0.3s ease-out;
}

@keyframes badge-appear {
    from { 
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.coord-icon {
    font-size: 1.25rem;
}

.coord-text {
    font-size: 0.875rem;
    color: var(--color-gray-700, #374151);
}

.coord-text strong {
    color: var(--color-black, #1a1a1a);
    font-family: monospace;
}

.coord-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 0.25rem;
}

.coord-edit-btn:hover {
    opacity: 1;
}

/* Manual Coordinates */
.manual-coordinates {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-lg, 12px);
    border: 1px solid var(--color-gray-200, #e5e7eb);
}

.coord-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.coord-field label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-gray-500, #9ca3af);
    margin-bottom: 0.25rem;
}

.coord-hint {
    font-size: 0.75rem;
    color: var(--color-gray-500, #9ca3af);
    margin-top: 0.5rem;
}

/* Form Messages */
.form-error {
    padding: 1rem;
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    border: 1px solid #F87171;
    border-radius: var(--radius-lg, 12px);
    color: #B91C1C;
    font-size: 0.9375rem;
    margin-top: 1rem;
}

.form-success {
    padding: 1rem;
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    border: 1px solid #6EE7B7;
    border-radius: var(--radius-lg, 12px);
    color: #047857;
    font-size: 0.9375rem;
    margin-top: 1rem;
    animation: success-appear 0.3s ease-out;
}

@keyframes success-appear {
    from { 
        opacity: 0;
        transform: translateY(-10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 1024px) {
    .kruhy-hero-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .kruhy-hero-visual {
        order: -1;
    }
    
    .circles-demo {
        width: 300px;
        height: 300px;
    }
    
    .demo-circle {
        width: 80px;
        height: 80px;
    }
    
    .demo-icon {
        font-size: 1.5rem;
    }
    
    .demo-label {
        font-size: 0.625rem;
    }
    
    .benefits-grid,
    .steps-grid,
    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gamification-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .circles-stats-bar {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .kruhy-hero {
        padding: calc(var(--header-height, 72px) + 2rem) 0 3rem;
    }
    
    .kruhy-hero-title {
        font-size: 2.5rem;
    }
    
    .kruhy-hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .kruhy-hero-cta {
        flex-direction: column;
    }
    
    .kruhy-recognized-user {
        flex-direction: column;
        text-align: center;
    }
    
    .benefits-grid,
    .steps-grid,
    .tips-grid {
        grid-template-columns: 1fr;
    }
    
    .circles-grid {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .circles-stats-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .circle-actions {
        flex-direction: column;
    }
    
    .location-input-wrapper {
        flex-direction: column;
    }
    
    .btn-gps-main {
        width: 100%;
        justify-content: center;
    }
    
    .coord-inputs {
        grid-template-columns: 1fr;
    }
    
    .gps-hint {
        flex-direction: row;
        text-align: left;
    }
}

@media (max-width: 480px) {
    .kruhy-hero-title {
        font-size: 2rem;
    }
    
    .circles-demo {
        width: 250px;
        height: 250px;
    }
    
    .demo-circle {
        width: 60px;
        height: 60px;
    }
    
    .demo-circle.demo-home { top: 30px; left: 30px; }
    .demo-circle.demo-work { top: 30px; right: 30px; }
    .demo-circle.demo-vacation { bottom: 30px; left: 30px; }
    .demo-circle.demo-family { bottom: 30px; right: 30px; }
    
    .demo-icon {
        font-size: 1.25rem;
    }
    
    .demo-user {
        width: 50px;
        height: 50px;
    }
}


/* ============================================
   REDUCED MOTION
   ============================================ */
/* The page runs several infinite animations (orbiting demo circles, pulsing
   rings, floating pins). Respect the OS-level preference. */
@media (prefers-reduced-motion: reduce) {
    .page-kruhy *,
    .page-kruhy *::before,
    .page-kruhy *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
