:root {
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --border: #e3e8f2;
    --text-main: #1c2333;
    --text-muted: #5f6b85;
    --primary: #4caf50;
    --primary-dark: #388e3c;
    --accent: #36cfc9;
    --success: #2ecc71;
    --error: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.08);
    --gradient: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

/* Tool Hero Section */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

/* Converter Interface */
.converter-interface {
    margin-bottom: 3rem;
}

.converter-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 32px;
    transition: background 0.3s ease, border 0.3s ease;
}

/* Columns Wrapper */
.columns-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 32px;
}

/* Card Sections */
.card-section {
    margin-bottom: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    gap: 16px;
    flex-wrap: wrap;
}

.section-title-group {
    flex: 1;
    min-width: 200px;
}

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
}

.section-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.section-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Input Wrapper */
.input-wrapper {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.ip-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--surface-muted);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
}

.ip-input:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.1);
}

.ip-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

.input-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Output Wrapper */
.output-wrapper {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-muted);
    min-height: 120px;
}

.decimal-output {
    width: 100%;
    min-height: 120px;
    padding: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
    color: var(--success);
    word-break: break-all;
    display: flex;
    align-items: center;
    background: transparent;
}

.decimal-output .placeholder-text {
    color: var(--text-muted);
    opacity: 0.5;
    font-weight: 400;
    font-style: italic;
}

.error-message {
    margin-top: 16px;
    padding: 16px;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--error);
    border-radius: 12px;
    color: var(--error);
    font-size: 14px;
    line-height: 1.5;
}

/* Action Section */
.action-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.action-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.action-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.action-info i {
    font-size: 14px;
    opacity: 0.7;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 12px;
    border: none;
    background: var(--gradient);
    color: #ffffff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: var(--shadow-soft);
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 50px rgba(76, 175, 80, 0.25);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface-muted);
    color: var(--text-main);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-action:hover {
    background: rgba(76, 175, 80, 0.08);
    border-color: var(--primary);
    transform: translateY(-1px);
}

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

.btn-action i {
    font-size: 14px;
}

.btn-action.copied {
    background: var(--success);
    border-color: var(--success);
    color: #ffffff;
}

.btn-action .btn-text {
    display: inline;
}

/* Details Section */
.details-section {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--surface-muted);
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.1);
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    border-radius: 12px;
    color: #ffffff;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    word-break: break-all;
}

/* Content Section */
.content-section {
    margin-top: 3rem;
    padding-top: 2rem;
}

.content-block h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 16px;
    margin-top: 32px;
}

.content-block h2:first-child {
    margin-top: 0;
}

.content-block h3 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
    margin-top: 24px;
    margin-bottom: 12px;
}

.content-block p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 16px;
}

.content-block ul {
    margin-bottom: 20px;
    padding-left: 24px;
}

.content-block li {
    margin-bottom: 10px;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 16px;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }

    .converter-card {
        padding: 20px;
        border-radius: 16px;
    }

    .columns-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-actions {
        width: 100%;
    }

    .btn-action {
        flex: 1;
    }

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

    .ip-input {
        font-size: 14px;
        padding: 14px 16px;
    }

    .decimal-output {
        font-size: 16px;
        padding: 16px;
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .tool-hero {
        gap: 20px;
    }

    .converter-card {
        padding: 16px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-subtitle {
        font-size: 13px;
    }

    .btn-primary {
        padding: 14px 24px;
        font-size: 15px;
    }

    .btn-action {
        padding: 10px 16px;
        font-size: 13px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .stat-value {
        font-size: 16px;
    }
}

/* Focus visible for accessibility */
.btn-primary:focus-visible,
.btn-action:focus-visible,
.ip-input:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

/* Loading state */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

