:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --secondary: #f1f5f9;
    --secondary-hover: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --bg-color: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(255, 255, 255, 0.2);
    --error: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    padding: 20px 0;
}

/* Background Shapes */
.background-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: rgba(99, 102, 241, 0.5);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: rgba(236, 72, 153, 0.4);
    bottom: -50px;
    right: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: rgba(56, 189, 248, 0.4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -2s;
}

@keyframes float {
    0% { transform: translateY(0px) scale(1); }
    100% { transform: translateY(30px) scale(1.1); }
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 25px;
    margin: 15px;
    border-radius: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transition: all 0.3s ease;
}

.grid-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    align-items: start;
}

#toggleInstructionsBtn {
    display: none;
}

@media (max-width: 768px) {
    .grid-layout {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }
    .left-column, .right-column {
        display: contents;
    }
    .left-column > .input-group {
        order: 1;
        width: 100%;
    }
    .right-column > .input-group {
        order: 2;
        width: 100%;
    }
    #indianAddressWidget {
        order: 3;
        margin-top: 5px !important;
        width: 100%;
    }
    #loader, #result, #error {
        order: 4;
        width: 100%;
    }
    #toggleInstructionsBtn {
        display: block !important;
        width: 100%;
        margin-bottom: 15px;
        background: rgba(99, 102, 241, 0.1);
        color: var(--primary);
        border: 1px dashed var(--primary);
    }
    #instructionsContainer {
        display: none;
    }
    #instructionsContainer.show {
        display: block;
    }
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Input Area */
.input-group {
    margin-bottom: 20px;
}

textarea {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    background: rgba(255, 255, 255, 0.5);
    font-family: monospace;
    font-size: 13px;
    color: var(--text-main);
    resize: none;
    transition: all 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

textarea:disabled {
    background: #f8fafc;
    border-style: solid;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Loader */
.loader {
    text-align: center;
    padding: 20px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 10px;
    border: 4px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Result Box */
.result {
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.result h3 {
    color: #10b981;
    margin-bottom: 15px;
}

.link-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    word-break: break-all;
}

.link-box a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link-box a:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    margin-bottom: 10px;
}

.btn.primary {
    background: var(--primary);
    color: white;
}

.btn.primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn.secondary {
    background: var(--secondary);
    color: var(--text-main);
}

.btn.secondary:hover {
    background: var(--secondary-hover);
}

/* Error */
.error {
    text-align: center;
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    animation: fadeIn 0.3s ease;
}

.error p {
    color: var(--error);
    font-weight: 600;
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

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