/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection in input fields and other interactive elements */
input, textarea, [contenteditable="true"] {
    -webkit-touch-callout: default;
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1a1a1a;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 50%, #b8860b 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    direction: rtl;
    text-align: right;
}

body, html, .app-title, .app-subtitle, .card, .card-header, .card-content, .size-display, .footer, .size-mapping-table, .ring-instruction, .first-plus-guide, .lock-label, .download-pdf-btn, .short-pdf-btn, .position-btn, .size-btn, .toggle-btn, .iranian-size-label, .ring-message {
    font-family: 'Vazirmatn', Vazirmatn, -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, Tahoma, 'Liberation Sans', sans-serif !important;
    font-display: swap;
}

/* App Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

/* Header */
.header {
    padding: 1rem 1.5rem 0.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.app-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.theme-toggle {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: rgba(26, 26, 26, 0.1);
    backdrop-filter: blur(10px);
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.theme-toggle:hover {
    background: rgba(26, 26, 26, 0.2);
    transform: scale(1.05);
}

.theme-icon {
    position: absolute;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-icon {
    opacity: 0;
    transform: rotate(180deg);
}

body.dark-mode .light-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

body.dark-mode .dark-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.ring-icon {
    font-size: 2.5rem;
    animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
}

.app-subtitle {
    color: rgba(26, 26, 26, 0.7);
    font-size: 0.9rem;
    font-weight: 400;
    display: none;
}

/* Main Content */
.main-content {
    padding: 15px 15px 100px 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Modern Card Design */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin-bottom: 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: fit-content;
}

/* Make specific cards span multiple columns */
.instruction-card {
    grid-column: 1 / -1; /* Span all 4 columns */
}

.ring-sizer-card {
    grid-column: 1 / 3; /* Span first 2 columns */
}

.size-chart-card {
    grid-column: 3 / 5; /* Span last 2 columns */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-header h2 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a1a;
}

.card-content {
    padding: 1.5rem;
}

/* Size Display */
.size-display {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.current-size {
    font-size: 1.5rem;
    font-weight: 700;
    color: #b8860b;
}

.size-mm {
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* Instruction Steps */
.main-instruction {
    text-align: center;
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.6;
    font-weight: 500;
}

.help-icon {
    background: rgb(212, 175, 55);
    border: none;
    color: white;
    cursor: pointer;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
    margin-right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    font-size: 12px;
    font-weight: bold;
}

.help-icon:hover {
    background: rgb(184, 134, 11);
    transform: scale(1.1);
}

.help-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 220px;
    width: max-content;
    text-align: center;
    line-height: 1.5;
    white-space: nowrap;
    margin-top: 8px;
}

.help-icon[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.9);
    z-index: 1001;
    margin-top: 2px;
}

.card-header {
    overflow: visible;
}

/* Ring Container */
.ring-container {
    text-align: center;

}

.ring-workspace {
    position: relative;
    overflow: hidden;
    border: 2px solid #b8860b;
    border-radius: 18px;
    box-shadow: 0 2px 16px 0 rgba(212, 175, 55, 0.10);
    padding: 18px 0 18px 0;
    margin: 0 auto 18px auto;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}
.ring-grid-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-color: #fff;
    background-image:
        repeating-linear-gradient(to right, rgba(150,150,150,0.10) 0, rgba(150,150,150,0.10) 1px, transparent 1px, transparent 10px),
        repeating-linear-gradient(to bottom, rgba(150,150,150,0.10) 0, rgba(150,150,150,0.10) 1px, transparent 1px, transparent 10px),
        repeating-linear-gradient(to right, rgba(80,80,80,0.13) 0, rgba(80,80,80,0.13) 2px, transparent 2px, transparent 50px),
        repeating-linear-gradient(to bottom, rgba(80,80,80,0.13) 0, rgba(80,80,80,0.13) 2px, transparent 2px, transparent 50px);
    background-size: 10px 10px, 10px 10px, 50px 50px, 50px 50px;
    background-position: 0 0, 0 0, 0 0, 0 0;
    transition: filter 0.3s;
}
body.dark-mode .ring-grid-bg {
    filter: invert(1) brightness(0.8);
    background-color: #18191c;
}

.ring-positioner {
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring {
    position: relative;
    width: 120px;
    height: 120px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ring-outline {
    position: absolute;
    top: -7px;
    left: -7px;
    right: -7px;
    bottom: -7px;
    border: none;
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    animation: none;
}

@keyframes ringPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.05);
        opacity: 1;
    }
}

@keyframes ringGlow {
    0%, 100% { 
        box-shadow: 
            inset 0 0 20px rgba(255, 215, 0, 0.2),
            0 0 30px rgba(255, 215, 0, 0.3);
    }
    50% { 
        box-shadow: 
            inset 0 0 30px rgba(255, 215, 0, 0.4),
            0 0 40px rgba(255, 215, 0, 0.5);
    }
}

/* Luxury premium effects */
.app-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #ffd700, transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.ring-sparkle {
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.8);
    filter: blur(0.5px);
}

/* Enhanced button interactions */
.size-btn, .position-btn, .toggle-btn {
    position: relative;
    overflow: hidden;
}

.size-btn::before, .position-btn::before, .toggle-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
    border-radius: 50%;
}

.size-btn:active::before, .position-btn:active::before, .toggle-btn:active::before {
    width: 120px;
    height: 120px;
}

/* Premium typography effects */
.app-title {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark-mode .app-title {
    text-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.current-size {
    text-shadow: 0 1px 4px rgba(184, 134, 11, 0.3);
}

/* Luxury card hover effects */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.card:hover::before {
    left: 100%;
}

.ring-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 20px);
    height: calc(100% - 20px);
    border-radius: 50%;
    border: 2px solid #ffd700;
    background: #ffd700;
    box-shadow: 0 0 24px 6px rgba(212, 175, 55, 0.3) inset;
}

/* Position Controls */
.position-controls {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 3px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.position-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(212, 175, 55, 0.3);
}

.position-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.4);
}

.position-btn:active {
    transform: translateY(0);
}

.position-btn.center {
    background: linear-gradient(135deg, #b8860b 0%, #d4af37 100%);
}

/* Ring Sparkles */
.ring-sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    animation: sparkleAnimation 2s ease-in-out infinite;
}

.ring-sparkle-1 {
    top: 10%;
    right: 25%;
    animation-delay: 0s;
}

.ring-sparkle-2 {
    bottom: 20%;
    left: 15%;
    animation-delay: 0.7s;
}

.ring-sparkle-3 {
    top: 60%;
    right: 10%;
    animation-delay: 1.4s;
}

@keyframes sparkleAnimation {
    0%, 100% { 
        opacity: 0;
        transform: scale(0);
    }
    50% { 
        opacity: 1;
        transform: scale(1);
    }
}

.ring-instruction {
    margin-top: 1rem;
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Size Control */
.size-control {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
    direction: ltr;
}

.size-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.size-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(212, 175, 55, 0.6);
}

.size-btn:active {
    transform: translateY(0);
}

.slider-container {
    flex: 1;
    position: relative;
    height: 48px;
    display: flex;
    align-items: center;
}

.size-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e2e8f0 0%, #d4af37 0%, #ffd700 100%);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
    transition: all 0.2s ease;
}

.size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.6);
}

.size-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}

/* Chart Toggle */
.chart-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 4px;
    gap: 2px;
    direction: ltr;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.toggle-btn.active {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.4);
}

/* Size Chart */
.size-chart {
    display: grid;
    padding-left: 3px;
    grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
    gap: 5px;
    max-height: 200px;
    overflow-y: auto;
}

.size-item {
    padding: 5px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.size-item:hover {
    border-color: #d4af37;
    transform: translateY(-1px);
}

.size-item.active {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    color: white;
    border-color: #d4af37;
}

.size-number {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.size-diameter {
    font-size: 0.75rem;
    opacity: 0.8;
}



/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1200px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer p {
    color: #666;
    font-size: 0.875rem;
    margin: 0;
}

/* Responsive Design for 4-column layout */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
    }
    
    .instruction-card {
        grid-column: 1 / -1;
    }
    
    .ring-sizer-card {
        grid-column: 1 / 2;
    }
    
    .size-chart-card {
        grid-column: 2 / 3;
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
    
    .instruction-card,
    .ring-sizer-card,
    .size-chart-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .app-container {
        border: none;
        border-radius: 0;
    }
    
    .header {
        padding: 0px 15px ;
    }
    
    .app-title {
        font-size: 1.75rem;
    }
    
    .main-content {
        padding: 15px 15px 100px 15px;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card-header,
    .card-content {
        padding: 1rem;
    }
    
    .ring {
        width: 100px;
        height: 100px;
    }
    
    .size-control {
        gap: 0.75rem;
    }
    
    .size-btn {
        width: 40px;
        height: 40px;
    }
}

/* Custom Scrollbar */
.size-chart::-webkit-scrollbar {
    width: 4px;
}

.size-chart::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 2px;
}

.size-chart::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    border-radius: 2px;
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1f1f1f 100%);
    color: #f5f5f5;
}

body.dark-mode .app-container {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .app-title {
    color: #f5f5f5;
}

body.dark-mode .app-subtitle {
    color: rgba(245, 245, 245, 0.7);

}

body.dark-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
}

body.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .card {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
}

body.dark-mode .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-header h2 {
    color: #f5f5f5;
}

body.dark-mode .main-instruction {
    color: #e0e0e0;
}

body.dark-mode .help-icon {
    background: #ffd700;
    color: #000;
}

body.dark-mode .help-icon:hover {
    background: #daa520;
}

body.dark-mode .help-icon[data-tooltip]:hover::after {
    background: rgba(0, 0, 0, 0.95);
    color: #f5f5f5;
    border-color: #ffd700;
}

body.dark-mode .ring-workspace {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
    border-color: rgba(212, 175, 55, 0.4);
}



body.dark-mode .size-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #333333 100%);
    color: #f5f5f5;
}

body.dark-mode .chart-toggle {
    background: #333333;
}

body.dark-mode .toggle-btn {
    color: #b0b0b0;
}

body.dark-mode .position-controls {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-mode .footer {
    background: rgba(0, 0, 0, 0.8);
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .footer p {
    color: #b0b0b0;
} 

.first-plus-guide {
    margin: 20px auto 15px auto;
    max-width: 90%;
    background: linear-gradient(90deg, #fffbe6 0%, #fffde4 100%);
    color: #b8860b;
    border: 1.5px dashed #ffd700;
    border-radius: 12px;
    box-shadow: 0 2px 12px 0 rgba(212, 175, 55, 0.10);
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    padding: 12px 18px;
    z-index: 10;
    transition: opacity 0.4s;
    position: relative;
    animation: fadeInUp 0.7s cubic-bezier(0.4,0,0.2,1);
}

.first-plus-guide.hide {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

body.dark-mode .first-plus-guide {
    background: linear-gradient(90deg, #2d2100 0%, #3a2a00 100%);
    color: #ffd700;
    border-color: #b8860b;
    box-shadow: 0 2px 16px 0 rgba(212, 175, 55, 0.18);
} 

.lock-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0 15px 0;
    position: relative;
    gap: 15px;
}

.lock-button-container .lock-scroll-btn {
    position: relative;
}

.lock-button-container .side-buttons {
    display: flex;
    gap: 8px;
}

.lock-scroll-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffd700;
    border: none;
    border-radius: 50px;
    padding: 10px 15px;
    margin: 0;
    color: #1a1a1a;
    cursor: pointer;
    font-size: 16px;
}

.buttons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 20px auto;
    width: 100%;
    direction: ltr; /* This ensures share button appears on the left */
}

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ffd700;
    color: #1a1a1a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    order: 1; /* This ensures share button appears first */
}

.icon-btn:hover, .lock-scroll-btn:hover {
    transform: scale(1.05);
    background: #ffed4a;
}

.lock-scroll-btn .lock-icon {
    transition: filter 0.2s;
}
.lock-scroll-btn[aria-pressed="true"] .lock-icon {
    filter: drop-shadow(0 0 4px #ffd700);
}
.lock-scroll-btn .lock-label {
    font-size: 0.7rem;
    font-weight: 600;
}
body.dark-mode .lock-scroll-btn {
    background: linear-gradient(90deg, #b8860b 0%, #ffd700 100%);
    color: #fffbe6;
    border-color: #ffd700;
}
body.dark-mode .lock-scroll-btn:active, body.dark-mode .lock-scroll-btn[aria-pressed="true"] {
    background: linear-gradient(90deg, #ffd700 0%, #b8860b 100%);
    color: #fffbe6;
    border-color: #ffd700;
}
body.dark-mode .lock-scroll-btn[aria-pressed="true"] .lock-icon {
    filter: drop-shadow(0 0 6px #ffd700);
} 

.fixed-size-footer {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 24px 0 rgba(212, 175, 55, 0.13), 0 -1.5px 8px 0 rgba(0,0,0,0.04);
    -webkit-box-shadow: 0 -4px 24px 0 rgba(212, 175, 55, 0.13), 0 -1.5px 8px 0 rgba(0,0,0,0.04);
    padding: 18px 0 14px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 18px 18px 0 0;
    transition: background 0.3s, backdrop-filter 0.3s, box-shadow 0.3s;
}
.fixed-size-footer .size-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}
@media (max-width: 600px) {
    .fixed-size-footer {
        padding: 14px 0 10px 0;
        border-radius: 16px 16px 0 0;
    }
    .fixed-size-footer .size-display {
        font-size: 1.05rem;
    }
}
body.dark-mode .fixed-size-footer {
    background: rgba(26, 26, 26, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 24px 0 rgba(212, 175, 55, 0.18), 0 -1.5px 8px 0 rgba(0,0,0,0.08);
    -webkit-box-shadow: 0 -4px 24px 0 rgba(212, 175, 55, 0.18), 0 -1.5px 8px 0 rgba(0,0,0,0.08);
}
body.dark-mode .fixed-size-footer .size-display {
    color: #ffd700;
}
body.dark-mode .fixed-size-footer .current-size {
    color: #ffd700;
}
body.dark-mode .fixed-size-footer .size-mm {
    color: #fffbe6;
}
@media (max-width: 600px) {
    .fixed-size-footer {
        font-size: 0.95rem;
        padding: 7px 0 6px 0;
    }
    .fixed-size-footer .size-display {
        gap: 10px;
    }
} 

.size-mapping-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fffbe6;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px 0 rgba(212, 175, 55, 0.08);
    font-size: 1rem;
    margin: 0 auto;
    direction: ltr;
}
.size-mapping-table th, .size-mapping-table td {
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
    border-bottom: 1px solid #ffe066;
}
.size-mapping-table th {
    background: #ffd700;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
}
.size-mapping-table tr:last-child td {
    border-bottom: none;
}
.size-mapping-table tbody tr {
    cursor: pointer;
    transition: background 0.2s;
}
.size-mapping-table tbody tr.selected, .size-mapping-table tbody tr:hover {
    background: linear-gradient(90deg, #fffbe6 0%, #ffe066 100%);
    color: #b8860b;
}
.size-mapping-table td {
    color: #1a1a1a;
    font-weight: 700;
}
body.dark-mode .size-mapping-table {
    background: #2d2100;
    box-shadow: 0 2px 16px 0 rgba(212, 175, 55, 0.18);
}
body.dark-mode .size-mapping-table th {
    background: #b8860b;
    color: #fffbe6;
}
body.dark-mode .size-mapping-table td {
    color: #ffd700;
}
body.dark-mode .size-mapping-table tbody tr.selected, body.dark-mode .size-mapping-table tbody tr:hover {
    background: linear-gradient(90deg, #3a2a00 0%, #b8860b 100%);
    color: #ffd700;
}
@media (max-width: 600px) {
    .size-mapping-table th, .size-mapping-table td {
        padding: 7px 4px;
        font-size: 0.95rem;
    }
} 

.ring-diameter-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.7);
    border-radius: 16px;
    padding: 2px 6px;
    z-index: 2;
    pointer-events: none;
    box-shadow: 0 1px 6px 0 rgba(0,0,0,0.08);
    max-width: 90%;
    white-space: nowrap;
    gap: 2px;
}
.mm-value {
    font-weight: bold;
    color: #222;
    line-height: 1;
    margin: 0 2px;
    display: inline-block;
    vertical-align: middle;
}
.arrow {
    font-size: 1.1em;
    color: #444;
    opacity: 0.8;
    vertical-align: middle;
    margin: 0 2px;
    display: inline-block;
}
body.dark-mode .ring-diameter-label {
    color: #ffd700;
    background: rgba(24, 25, 28, 0.7);
}
body.dark-mode .mm-value {
    color: #ffd700;
}
body.dark-mode .arrow {
    color: #ffd700;
    opacity: 0.7;
} 

.diameter-svg-label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
}
.diameter-svg-label svg {
    width: 100%;
    height: 100%;
    display: block;
}
.diameter-svg-label text {
    font-family: inherit;
    font-weight: bold;
    fill: #111;
    dominant-baseline: middle;
    text-anchor: middle;
    z-index: 15;
}
.diameter-svg-label .diameter-arrow {
    stroke: #888;
    stroke-width: 0.9;
    marker-end: url(#bar-marker);
    marker-start: url(#bar-marker);
}
body.dark-mode .diameter-svg-label text {
    fill: #111;
}
body.dark-mode .diameter-svg-label .diameter-arrow {
    stroke: #888;
}

.iranian-size-label {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.3rem;
    font-weight: bold;
    color: rgba(184, 134, 11, 0.3);
    z-index: 1;
    pointer-events: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

body.dark-mode .iranian-size-label {
    color: rgba(65, 56, 8, 0.3);
}

.ring-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 180px;
    min-height: 80px;
    padding: 24px 32px;
    border-radius: 22px;
    font-size: 2.1rem;
    font-weight: 900;
    color: #fffbe6;
    /* No background */
    background: none;
    box-shadow: none;
    text-align: center;
    z-index: 1;
    animation: ringMessageBounce 0.7s cubic-bezier(.68,-0.55,.27,1.55);
    border: none;
    user-select: none;
    pointer-events: none;
    text-shadow: 0 2px 12px #b8860b, 0 1px 2px #fffbe6;
}
.ring-message--min {
    color: #b8860b;
    font-size: 2.2rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 12px #fffbe6, 0 1px 2px #ffd700;
    white-space: nowrap;
}
.ring-message--max {
    color: #b8860b;
    font-size: 2.2rem;
    letter-spacing: 2px;
    text-shadow: 0 2px 12px #fffbe6, 0 1px 2px #ffd700;
    white-space: nowrap;
}
@keyframes ringMessageBounce {
    0% { opacity: 0; transform: translate(-50%, -60%) scale(0.7); }
    60% { opacity: 1; transform: translate(-50%, -48%) scale(1.15); }
    80% { transform: translate(-50%, -52%) scale(0.95); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.buttons-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    width: 100%;
    padding: 0;
    gap: 5px;
    direction: rtl;
}

.icon-round-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 50%;
    background: #ffd700;
    color: #1a1a1a;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-round-btn:hover, .lock-scroll-btn:hover {
    background: #ffd700;
}

.ring-icon.center-ring-icon {
    font-size: 1.3rem;
    margin: 0 8px 0 0;
    display: inline-block;
    vertical-align: middle;
    position: relative;
    top: 2px;
}

.home-btn {
    width: 36px;
    height: 36px;
    background: rgba(26, 26, 26, 0.1);
    border: none;
    border-radius: 10px;
    box-shadow: none;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 8px 0 0;
    padding: 0;
    outline: none;
}
.home-btn:hover {
    background: rgba(26, 26, 26, 0.2);
    transform: scale(1.05);
}
body.dark-mode .home-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #f5f5f5;
}
body.dark-mode .home-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.home-btn svg {
    display: block;
}

.home-btn svg path {
    stroke: #1a1a1a;
    transition: stroke 0.2s;
}
body.dark-mode .home-btn svg path {
    stroke: #b8860b;
}

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

.app-title {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a1a;
    gap: 0.5rem;
    margin: 0;
}

.see-rings-btn {
    background-image: url('Rose Gold Engagement Ring Shine.png');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    color: #fffbe6;
    font-size: 1.18rem;
    font-weight: 900;
    border: none;
    border-radius: 18px;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s, transform 0.1s;
    position: relative;
    z-index: 2;
    overflow: hidden;
    animation: seeRingsPulse 1.6s infinite;
    text-shadow: 0 2px 8px #000, 0 1px 2px #b8860b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0;
    padding: 16px 32px;
}
.see-rings-btn:hover, .see-rings-btn:focus {
    color: #ffd700;
    transform: scale(1.04);
}
.see-rings-icon {
    font-size: 1.6em;
    animation: seeRingsIconWave 1.2s infinite alternate;
    display: inline-block;
}
@keyframes seeRingsPulse {
    0%, 100% { box-shadow: 0 4px 18px 0 rgba(212, 175, 55, 0.13); }
    50% { box-shadow: 0 0 32px 8px #ffe06644; }
}
@keyframes seeRingsIconWave {
    0% { transform: rotate(-10deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.15); }
    100% { transform: rotate(-10deg) scale(1); }
}

.see-rings-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 36px auto 0 auto;
    aspect-ratio: 1.2/1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.see-rings-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22px;
    filter: blur(2.5px) brightness(0.7);
    z-index: 1;
    pointer-events: none;
    user-select: none;
}
.see-rings-btn {
    position: relative;
    z-index: 2;
    margin: 0;
    box-shadow: 0 4px 18px 0 rgba(212, 175, 55, 0.18);
}

@media (max-width: 600px) {
    .header {
        padding: 10px 10px 6px 10px;
    }
    .app-title {
        font-size: 1.1rem;
    }
    .ring-icon.center-ring-icon {
        font-size: 1.2rem;
    }
    .header-top {
        gap: 0.5rem;
    }
}