/* styles.css */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-gradient: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    --card-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --text-light: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.8);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --border-radius: 20px;
    --glow: 0 0 20px rgba(102, 126, 234, 0.5);
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--dark-gradient);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.3rem;
    font-weight: 300;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
    backdrop-filter: blur(10px);
}

.converter-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    padding: 3rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
}

.converter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.input-group {
    margin-bottom: 2.5rem;
}

.input-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-light);
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    display: flex;
    gap: 1rem;
    align-items: stretch;
}

#number {
    flex: 1;
    padding: 1.2rem 1.5rem;
    font-size: 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#number:focus {
    outline: none;
    border-color: transparent;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 30px rgba(79, 172, 254, 0.4);
    transform: translateY(-2px);
}

#number::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#convert-btn {
    padding: 1.2rem 2.5rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(79, 172, 254, 0.3);
    position: relative;
    overflow: hidden;
}

#convert-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

#convert-btn:hover::before {
    left: 100%;
}

#convert-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(79, 172, 254, 0.5);
}

#convert-btn:active {
    transform: translateY(-1px);
}

.btn-icon {
    font-weight: bold;
    font-size: 1.2rem;
}

.result-section {
    margin-top: 2.5rem;
}

.result-label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-light);
    font-size: 1.2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#output {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 2rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    transition: all 0.3s ease;
    text-align: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

#output::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--success-gradient);
    opacity: 0.1;
    z-index: -1;
}

#output:empty::before {
    content: "Roman numeral will appear here";
    color: var(--text-muted);
    font-style: italic;
    font-weight: normal;
    font-size: 1.2rem;
    background: none;
    -webkit-text-fill-color: var(--text-muted);
}

.info-section {
    margin-top: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.info-section::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.info-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-size: 1.1rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.info-text {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
}

/* Animation for result */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(79, 172, 254, 0.3);
    }

    50% {
        box-shadow: 0 0 30px rgba(79, 172, 254, 0.6);
    }
}

#output:not(:empty) {
    animation: fadeInUp 0.6s ease-out;
    background: var(--success-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    border-color: rgba(67, 233, 123, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .title {
        font-size: 2.5rem;
    }

    .converter-card {
        padding: 2rem;
    }

    .input-wrapper {
        flex-direction: column;
    }

    #convert-btn {
        justify-content: center;
        width: 100%;
    }

    #output {
        font-size: 2rem;
        min-height: 80px;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 2rem;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .header {
        margin-bottom: 2rem;
    }

    #output {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }
}

/* Error and success states with gradients */
.error {
    background: var(--warning-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    border-color: rgba(250, 112, 154, 0.3) !important;
    animation: glowPulse 2s infinite !important;
}

.success {
    background: var(--success-gradient) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    border-color: rgba(67, 233, 123, 0.3) !important;
}

/* Floating animation for card */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.converter-card {
    animation: float 6s ease-in-out infinite;
}

/* Particle background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(79, 172, 254, 0.1) 0%, transparent 50%);
    z-index: -1;
}
