:root {
    --bg-color: #07080e;
    --panel-bg: rgba(18, 20, 38, 0.65);
    --card-bg: rgba(30, 32, 58, 0.45);
    --input-bg: rgba(13, 14, 26, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(0, 229, 255, 0.5);
    --accent-glow: rgba(0, 229, 255, 0.15);
    --text-primary: #ffffff;
    --text-secondary: #9aa0c2;
    --accent-cyan: #00e5ff;
    --accent-purple: #9d4edd;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', 'Inter', sans-serif;
    user-select: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 30px 20px;
    overflow-x: hidden;
    position: relative;
    /* Animated mesh/glow backgrounds */
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(157, 78, 221, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(0, 229, 255, 0.12) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, #0d0f1d 0%, #06070c 100%);
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(255, 255, 255, 0.15) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

/* Container */
.system-panel {
    width: 900px;
    max-width: 100%;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    overflow: hidden;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    z-index: 1;
    position: relative;
}

/* Responsive Grid */
@media (max-width: 860px) {
    .system-panel {
        grid-template-columns: 1fr;
        width: 100%;
        max-width: 480px;
    }
    .preview-card {
        min-height: 200px !important;
    }
}

/* Left Column: Form Controls */
.controls-container {
    padding: 35px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    border-right: 1px solid var(--border-color);
}

@media (max-width: 860px) {
    .controls-container {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 25px;
    }
}

/* Header styling */
.panel-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.header-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    text-transform: uppercase;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.header-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Controls Grid within Container */
.controls-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 500px) {
    .controls-stack {
        grid-template-columns: 1fr;
    }
}

/* Control group wrapper */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Spans full width */
.control-group.full-width {
    grid-column: span 2;
}

@media (max-width: 500px) {
    .control-group.full-width {
        grid-column: span 1;
    }
}

.control-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.control-label::before {
    content: '';
    width: 5px;
    height: 5px;
    background-color: var(--accent-cyan);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 6px var(--accent-cyan);
}

/* Inputs & Dropdowns styling */
.custom-input, .custom-select {
    height: 44px;
    background-color: var(--input-bg);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 0 16px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-input::placeholder {
    color: rgba(154, 160, 194, 0.4);
    font-weight: 500;
}

.custom-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%239aa0c2' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 36px;
}

.custom-input:hover, .custom-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background-color: rgba(30, 32, 58, 0.6);
}

.custom-input:focus, .custom-select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 
        0 0 12px var(--accent-glow),
        inset 0 1px 2px rgba(0, 0, 0, 0.2);
    background-color: var(--input-bg);
}

/* Dropdown Options Group */
optgroup {
    background-color: #0d0f1d;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.5px;
}

option {
    background-color: #121426;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 13px;
    padding: 10px;
}

/* Right Column: Preview Panel */
.preview-container {
    padding: 35px;
    background: rgba(10, 11, 22, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    gap: 20px;
}

@media (max-width: 860px) {
    .preview-container {
        padding: 25px;
        background: transparent;
    }
}

/* Live Preview Card */
.preview-card {
    width: 100%;
    height: 100%;
    min-height: 280px;
    background-color: rgba(5, 6, 12, 0.75);
    border: 1.5px solid var(--border-color);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* The actual title element */
.title-text-element {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    position: relative;
    white-space: nowrap;
    display: inline-block;
    z-index: 2;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    max-width: 90%;
    overflow-x: auto;
    scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.title-text-element::-webkit-scrollbar {
    display: none; /* Hide scrollbar for Chrome, Safari, Opera */
}

/* Send Button styling */
.btn-primary {
    width: 100%;
    height: 46px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 229, 255, 0.2);
    letter-spacing: 0.5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary::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: 0.5s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 229, 255, 0.4);
    filter: brightness(1.1);
}

.btn-primary:hover::before {
    left: 100%;
    transition: 0.6s ease-in-out;
}

.btn-primary:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(0, 229, 255, 0.2);
}

/* Button States */
.btn-primary.loading {
    background: var(--input-bg);
    border: 1.5px solid var(--border-color);
    color: var(--text-secondary);
    pointer-events: none;
    box-shadow: none;
}

.btn-primary.success {
    background: linear-gradient(135deg, #2ec4b6, #00f5d4);
    box-shadow: 0 4px 20px rgba(46, 196, 182, 0.3);
    color: var(--text-primary);
}

.btn-primary.error {
    background: linear-gradient(135deg, #e63946, #ff4d6d);
    box-shadow: 0 4px 20px rgba(230, 57, 70, 0.3);
    color: var(--text-primary);
}

/* Wiggle animation for input error */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.shake-input {
    animation: shake 0.4s ease-in-out;
    border-color: #ff4d6d !important;
    box-shadow: 0 0 12px rgba(255, 77, 109, 0.25) !important;
}

/* Mobile Devices Optimization (HP) */
@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .system-panel {
        border-radius: 18px;
    }
    .controls-container {
        padding: 20px 16px;
        gap: 16px;
    }
    .preview-container {
        padding: 16px;
    }
    .controls-stack {
        gap: 12px;
    }
    .custom-input, .custom-select {
        height: 40px;
        font-size: 12px;
        padding: 0 12px;
    }
    .btn-primary {
        height: 42px;
        font-size: 13px;
    }
}


