:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --primary: #8b5cf6;
    --primary-glow: rgba(139, 92, 246, 0.5);
    --cyan: #06b6d4;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top center, var(--bg-dark), var(--bg-darker));
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.app-container {
    max-width: 800px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h1 {
    text-align: center;
    margin: 0;
    font-weight: 900;
    font-size: 2.5rem;
    background: linear-gradient(to right, var(--cyan), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -1px;
}

.visualizer-section {
    text-align: center;
    padding: 3rem 0;
    position: relative;
}

.prob-number {
    font-size: 7rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 0 40px var(--primary-glow);
    transition: text-shadow 0.3s ease;
}

.progress-track {
    width: 100%;
    height: 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--danger), var(--cyan), var(--success));
    background-size: 200% 100%;
    border-radius: 20px;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1), background-position 1.5s ease;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

.status-message {
    margin-top: 1.5rem;
    font-size: 1.2rem;
    color: var(--cyan);
    font-weight: 600;
    height: 3rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

input[type="text"] {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

button {
    width: 100%;
    padding: 1.2rem;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-analyze {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: white;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.3);
    margin-top: 1rem;
}

.btn-analyze:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(139, 92, 246, 0.5);
}

.btn-analyze:disabled {
    background: #475569;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: transparent;
    color: var(--cyan);
    border: 1px dashed var(--cyan);
    padding: 0.8rem;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.btn-secondary:hover {
    background: rgba(6, 182, 212, 0.1);
    transform: translateY(-2px);
}

.btn-share {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px dashed var(--success);
    margin-top: 1rem;
    display: none;
}

.btn-share:hover {
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.2);
}

.social-share-row {
    display: none;
    justify-content: center;
    /* Center mein layega */
    gap: 15px;
    margin-top: 1.5rem;
}

.btn-social {
    width: 45px !important;
    /* Fixed size for round shape */
    height: 45px !important;
    border-radius: 50% !important;
    /* Perfect circle banayega */
    font-size: 1.3rem !important;
    /* Icon ka size */
    color: white;
    display: inline-flex !important;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    padding: 0 !important;
    /* Purani padding hatayega */
}

.btn-wa {
    background: #25D366;
}

.btn-fb {
    background: #1877F2;
}

.btn-ig {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.btn-wa:hover {
    background: #1ebc5a;
    transform: translateY(-2px);
}

.btn-fb:hover {
    background: #166fe5;
    transform: translateY(-2px);
}

.btn-ig:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-reset {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    margin-top: 1rem;
}

.btn-reset:hover {
    border-color: var(--danger);
    color: var(--danger);
}

.info-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
    margin-top: 1.5rem;
}

.info-link:hover {
    color: var(--cyan);
    text-decoration: underline;
}

.log-item {
    background: rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--cyan);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-reasoning {
    color: var(--text-muted);
    font-style: italic;
    margin-top: 1rem;
    line-height: 1.6;
}

.loader {
    display: none;
    text-align: center;
    color: var(--cyan);
    font-weight: bold;
    margin-top: 1rem;
    animation: pulse 1s infinite alternate;
}

@keyframes pulse {
    from {
        opacity: 0.5;
    }

    to {
        opacity: 1;
    }
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    max-width: 600px;
    width: 90%;
    position: relative;
    padding: 2.5rem;
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close-btn:hover {
    color: var(--danger);
}

canvas {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

/* Mobile Responsive Fix */
@media screen and (max-width: 768px) {
    body {
        padding: 10px !important;
    }

    .app-container {
        gap: 1rem !important;
    }

    .glass-card {
        padding: 20px !important;
        border-radius: 16px !important;
    }

    h1 {
        font-size: 2rem !important;
    }

    .visualizer-section {
        padding: 1.5rem 0 !important;
    }

    .prob-number {
        font-size: 4.5rem !important;
        margin-bottom: 1rem !important;
    }

    .status-message {
        font-size: 1rem !important;
        height: auto !important;
        margin-bottom: 1rem !important;
    }

    input[type="text"] {
        font-size: 1rem !important;
        padding: 0.8rem !important;
    }

    .btn-analyze,
    .btn-share,
    .btn-reset,
    .btn-social {
        padding: 1rem !important;
        font-size: 1rem !important;
    }

    /* Mobile par bhi icons ko ek line (row) mein rakhega */
    .social-share-row {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 15px !important;
    }
}