/**
 * Professional Ring Size Converter CSS
 * CalcTechLab.com
 * Modern, responsive, and visually stunning design
 */

/* ========================================
   1. RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   2. HEADER SECTION
   ======================================== */

.converter-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    animation: fadeInDown 0.6s ease;
}

.converter-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.converter-header .subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 300;
}

.converter-header .icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: inline-block;
    animation: rotate 3s ease-in-out infinite;
}

/* ========================================
   3. MAIN LAYOUT
   ======================================== */

.converter-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    margin-bottom: 40px;
}

/* ========================================
   4. CONVERTER CARD
   ======================================== */

.converter-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeIn 0.8s ease;
}

.converter-card-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    padding: 25px 30px;
    color: white;
}

.converter-card-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.converter-card-header p {
    opacity: 0.9;
    font-size: 1rem;
}

.converter-card-body {
    padding: 30px;
}

/* ========================================
   5. INPUT SECTION
   ======================================== */

.input-section {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group select,
.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group select:focus,
.input-group input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.unit-toggle-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.unit-toggle-container label {
    font-weight: 600;
    color: #475569;
}

.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #2563eb;
}

input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.unit-labels {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: #64748b;
}

/* ========================================
   6. RESULTS SECTION
   ======================================== */

.results-section {
    display: none;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e2e8f0;
}

.results-section.show {
    display: block;
    animation: fadeInUp 0.5s ease;
}

.results-section h3 {
    color: #1e40af;
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.result-item {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #2563eb;
}

.result-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.5rem;
    color: #1e40af;
    font-weight: 700;
}

.size-range-display {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #f59e0b;
}

.size-range-display .label {
    font-size: 0.9rem;
    color: #92400e;
    font-weight: 600;
    margin-bottom: 5px;
}

.size-range-display .value {
    font-size: 1.8rem;
    color: #b45309;
    font-weight: 700;
}

/* ========================================
   7. RING VISUALIZATION
   ======================================== */

.ring-visualization {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeInRight 0.8s ease;
}

.ring-visualization h3 {
    color: #1e40af;
    font-size: 1.5rem;
    margin-bottom: 20px;
    text-align: center;
}

.ring-visual-container {
    position: relative;
    width: 100%;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 15px;
    overflow: hidden;
}

.finger-svg {
    position: absolute;
    width: 80px;
    height: 300px;
    z-index: 1;
}

.ring-svg {
    position: absolute;
    width: 300px;
    height: 300px;
    z-index: 2;
}

.ring-circle {
    fill: none;
    stroke-width: 6;
    stroke: #2563eb;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.ring-inner {
    fill: none;
    stroke-width: 2;
    stroke: #3b82f6;
    opacity: 0.5;
}

.finger-shape {
    fill: #fde68a;
    stroke: #f59e0b;
    stroke-width: 2;
}

.ring-size-label {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    color: #1e40af;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

/* ========================================
   8. CONVERSION TABLE
   ======================================== */

.table-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 1s ease;
}

.table-section h2 {
    color: #1e40af;
    font-size: 2rem;
    margin-bottom: 20px;
}

.table-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.table-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.table-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.print-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.size-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.size-table thead {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.size-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.size-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.size-table tbody tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
}

.size-table tbody tr.highlighted {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    font-weight: 600;
}

.size-table td {
    padding: 12px 15px;
    font-size: 0.95rem;
    color: #475569;
}

.size-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ========================================
   9. MEASUREMENT GUIDE
   ======================================== */

.guide-section {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 1.2s ease;
}

.guide-section h2 {
    color: #1e40af;
    font-size: 2rem;
    margin-bottom: 30px;
}

.guide-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.guide-step {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #2563eb;
    transition: all 0.3s ease;
}

.guide-step:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 40px;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e40af;
    margin-bottom: 10px;
}

.step-description {
    color: #64748b;
    line-height: 1.6;
}

.guide-tips {
    background: #fef3c7;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
}

.guide-tips h3 {
    color: #b45309;
    font-size: 1.3rem;
    margin-bottom: 15px;
}

.guide-tips ul {
    list-style: none;
    padding: 0;
}

.guide-tips li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #92400e;
}

.guide-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #f59e0b;
    font-weight: 700;
}

/* ========================================
   10. SEO CONTENT SECTION
   ======================================== */

.seo-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 1.4s ease;
}

.seo-content h2 {
    color: #1e40af;
    font-size: 2rem;
    margin-bottom: 20px;
}

.seo-content h3 {
    color: #2563eb;
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
}

.seo-content p {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 15px;
}

.seo-content ul,
.seo-content ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.seo-content li {
    color: #475569;
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 10px;
}

.faq-section {
    margin-top: 40px;
}

.faq-item {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #2563eb;
}

.faq-question {
    font-weight: 700;
    color: #1e40af;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.faq-answer {
    color: #475569;
    line-height: 1.7;
}

/* ========================================
   11. NOTIFICATIONS
   ======================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.notification-info {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
}

/* ========================================
   12. ANIMATIONS
   ======================================== */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

@keyframes rotate {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(180deg);
    }
}

/* ========================================
   13. RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 1200px) {
    .converter-layout {
        grid-template-columns: 1fr;
    }
    
    .ring-visualization {
        margin-top: 30px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .converter-header h1 {
        font-size: 2rem;
    }
    
    .converter-header .subtitle {
        font-size: 1rem;
    }
    
    .converter-card-body {
        padding: 20px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-steps {
        grid-template-columns: 1fr;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .table-btn {
        width: 100%;
        justify-content: center;
    }
    
    .seo-content {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .converter-header h1 {
        font-size: 1.5rem;
    }
    
    .ring-visual-container {
        height: 300px;
    }
    
    .ring-svg {
        width: 200px;
        height: 200px;
    }
}

/* ========================================
   14. EMBED MODE STYLES
   ======================================== */

.embed-mode {
    padding: 0;
    background: white;
}

.embed-mode .converter-header,
.embed-mode .seo-content,
.embed-mode .guide-section {
    display: none;
}

.embed-mode .converter-card {
    border-radius: 0;
    box-shadow: none;
}

/* ========================================
   15. PRINT STYLES
   ======================================== */

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .converter-header,
    .converter-card,
    .ring-visualization,
    .table-actions,
    .seo-content,
    .guide-section {
        display: none;
    }
    
    .table-section {
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }
    
    .size-table {
        page-break-inside: avoid;
    }
}