:root {
    /* Primary Colors */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --primary-hover: #1d4ed8;
    --primary-shadow: rgb(37 99 235 / 25%);
    
    /* Legacy Primary (for backward compatibility) */
    --primary-color: var(--primary);
    --primary-color-light: var(--primary-light);
    
    /* Semantic Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --accent: #36cfc9;
    
    /* Legacy Semantic (for backward compatibility) */
    --success-color: var(--success);
    --warning-color: var(--warning);
    --danger-color: var(--danger);
    
    /* Surface Colors */
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --surface-elevated: #ffffff;
    --background: #f8fafc;
    
    /* Legacy Surface (for backward compatibility) */
    --surface-color: var(--surface);
    --light-bg: var(--background);
    --secondary-bg: #e2e8f0;
    
    /* Border Colors */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-dark: #cbd5e1;
    
    /* Legacy Border (for backward compatibility) */
    --border-color: var(--border);
    
    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-inverse: #ffffff;
    
    /* Legacy Text (for backward compatibility) */
    --text-primary: var(--text-main);
    --text-secondary: var(--text-muted);
    --secondary-color: #334155;
    
    /* Shadow System */
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
    --shadow-md: 0 4px 12px rgb(15 23 42 / 0.08);
    --shadow-lg: 0 12px 24px rgb(15 23 42 / 0.12);
    --shadow-xl: 0 20px 25px rgb(15 23 42 / 0.1);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-full: 9999px;
    
    /* Angle Converter Variables (for educational content styling) */
    --angle-primary: #2563eb;
    --angle-primary-dark: #1d4ed8;
    --angle-accent: #0ea5e9;
    --angle-surface: #ffffff;
    --angle-border: #e2e8f0;
    --angle-text: #0f172a;
    --angle-muted: #64748b;
    --angle-success: #22c55e;
    --angle-radius-lg: 1.5rem;
    --angle-radius-md: 1rem;
    --angle-radius-sm: 0.75rem;
    --angle-shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.08);
    --angle-shadow-lg: 0 30px 60px rgba(37, 99, 235, 0.12);
}

.hex-ip-page {
    padding: 2rem 0;
}

.converter-intro {
    margin-bottom: 3rem;
}

.converter-title {
    font-size: clamp(2.25rem, 4vw, 3rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.converter-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    max-width: 860px;
}

.converter-meta {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
}

.meta-chip {
    background: var(--surface-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0.45rem 0.95rem;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.converter-main {
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.converter-card {
    padding: 0rem 2rem;
    height: 100%;
}

.converter-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1rem;
}

.label-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.converter-input {
    width: 100%;
    padding: 1rem 1.15rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: monospace;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background: var(--surface-color);
    box-shadow: inset 0 1px 2px rgb(15 23 42 / 0.04);
    resize: vertical;
    min-height: 120px;
}

.converter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-color-light);
}

.converter-input:hover {
    border-color: var(--primary-color);
}

.converter-output {
    width: 100%;
    padding: 1rem 1.15rem;
    border: 2px solid #28a745;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-family: monospace;
    color: #155724;
    background: #e8f5e8;
    resize: vertical;
    min-height: 100px;
}

.info-card {
    background: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    height: 100%;
}

.info-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.1);
}

.info-label {
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    display: block;
    margin-bottom: 0.5rem;
}

.info-value {
    color: #333;
    font-weight: 700;
    margin: 0;
    font-size: 1.1rem;
    word-break: break-all;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: stretch;
    width: 100%;
}

.form-actions .convert-btn,
.form-actions .ghost-btn {
    flex: 1 1 auto;
    min-width: 140px;
}

.convert-btn {
    flex: 1 1 200px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px var(--primary-shadow);
}

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

.convert-btn:disabled {
    cursor: wait;
    opacity: 0.9;
}

.ghost-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 0.9rem;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.ghost-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.status-bar {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.status-bar svg {
    flex-shrink: 0;
}

.status-info {
    background: var(--primary-color-light);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.results-container {
    border-radius: var(--radius-md);
    padding: 2rem;
    border: 1px solid var(--border-color);
    position: relative;
    background: var(--light-bg);
    min-height: 300px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.result-output-group {
    margin-bottom: 1rem;
}

.result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.copy-button {
    width: 100%;
    background: #f1f5f9;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #405063 !important;
    border: 1px solid #dde3e7;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.copy-button:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.copy-button.copied {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff !important;
}

.tooltip {
    position: relative;
    display: inline-flex;
}

.tooltip .tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--text-primary);
    font-weight: 700;
    cursor: help;
    border: none;
    font-size: 0.875rem;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 220px;
    background-color: var(--text-primary);
    color: white;
    text-align: left;
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    position: absolute;
    z-index: 10;
    bottom: 135%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.875rem;
    line-height: 1.4;
}

.tooltip:hover .tooltiptext,
.tooltip:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.convert-btn:focus,
.ghost-btn:focus,
.converter-input:focus,
.copy-button:focus {
    outline: 2px solid rgb(37 99 235 / 0.6);
    outline-offset: 3px;
}

.angle-seo-section {
    margin-top: clamp(3rem, 5vw, 4rem);
}

.angle-card {
    margin-top: clamp(2.5rem, 4vw, 3.5rem);
    background: var(--angle-surface);
    border-radius: var(--angle-radius-lg);
    padding: clamp(2rem, 4vw, 2.75rem);
    border: 1px solid rgba(148, 163, 184, 0.25);
    box-shadow: var(--angle-shadow-sm);
}

.angle-education-card h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--angle-text);
    margin-bottom: 1.5rem;
}

.angle-education-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--angle-text);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.angle-education-card .h4 {
    font-size: 1.15rem;
}

.angle-education-card p {
    font-size: 1rem;
    color: var(--angle-muted);
    line-height: 1.8;
    margin-bottom: 1.2rem;
}

.angle-education-card a {
    color: var(--angle-primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.angle-education-card a:hover {
    color: var(--angle-primary-dark);
}

.mb-3 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1.5rem;
}

.infographic-timeline {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.infographic-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.timeline-container {
    position: relative;
    padding: 2rem 0;
}

.timeline-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

.timeline-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-color);
}

.timeline-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    fill: none;
}

.timeline-era {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-years {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.infographic-conversion-formula {
    margin: 2rem 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.formula-box {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(14, 165, 233, 0.08) 100%);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 2px solid rgba(37, 99, 235, 0.2);
}

.formula-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.formula-content {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.formula-example {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
}

.share-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.share-modal-content {
    background-color: #ffffff;
    margin: 15% auto;
    padding: 3rem 4rem;
    border-radius: 8px;
    width: 90%;
    max-width: 750px;
    position: relative;
}

.share-modal-close {
    position: absolute;
    right: 3rem;
    top: 3rem;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: #9ca3af;
}

.share-modal-close:hover {
    color: #374151;
}

.share-url-container {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.share-url-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
}

.btn-copy-url {
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-copy-url:hover {
    background: #2563eb;
}

.social-share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    color: #ffffff;
    transition: all 0.2s ease;
}

.social-share-btn svg {
    flex-shrink: 0;
}

.social-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

.facebook-btn {
    background: #1877f2;
}

.facebook-btn:hover {
    background: #1565c0;
}

.twitter-btn {
    background: #1da1f2;
}

.twitter-btn:hover {
    background: #0d8bd9;
}

.linkedin-btn {
    background: #0a66c2;
}

.linkedin-btn:hover {
    background: #084d94;
}

.whatsapp-btn {
    background: #25d366;
}

.whatsapp-btn:hover {
    background: #1ebe57;
}

.reddit-btn {
    background: #ff4500;
}

.reddit-btn:hover {
    background: #e03d00;
}

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

.telegram-btn:hover {
    background: #0077b5;
}

@media (max-width: 991px) {
    .converter-main {
        padding: 1.5rem;
    }

    .converter-card {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hex-ip-page {
        padding: 2.5rem 0 3rem;
    }

    .converter-meta {
        gap: 0.5rem;
    }

    .converter-main {
        border-radius: 1.25rem;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .ghost-btn {
        width: 100%;
        justify-content: center;
    }

    .result-actions {
        grid-template-columns: 1fr;
    }

    .infographic-conversion-formula {
        grid-template-columns: 1fr;
    }

    .timeline-items {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .social-share-buttons {
        grid-template-columns: 1fr;
    }
    
    .share-modal-content {
        padding: 2rem 1.5rem;
    }
    
    .share-modal-close {
        right: 1.5rem;
        top: 1.5rem;
    }

    .converter-input {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }

    .converter-output {
        font-size: 0.875rem;
        padding: 0.875rem 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

