:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --warning: #f8961e;
    --danger: #d10303;
    --dark: #212529;
    --light: #f8f9fa;
    --glass: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--dark);
    line-height: 1.6;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f2027 url('/static/Assets/background.gif') no-repeat center center;
    background-size: cover;
    z-index: -1;
    filter: brightness(0.5);
    transition: background 0.3s ease;
}

.glass-container {
    width: 100%;
    max-width: 900px;
    background: var(--glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 20px;
    margin: 20px 0;
}

.header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.logo i {
    font-size: 24px;
    color: var(--success);
}

.date-display {
    background: rgba(76, 202, 240, 0.995);
    color: rgb(0, 0, 0);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(5px);
}

.form-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* ===== NEW STYLES ===== */
/* Dual Input Row Layout */
.dual-input-row {
    display: flex;
    gap: 15px;
    align-items: flex-end; /* Aligns inputs at bottom */
}

/* Handle Field Container (hidden by default) */
#manualHandleGroup {
    background: rgba(255,255,255,0.8);
    border-radius: 8px;
    padding: 10px;
    border: 1px solid rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .dual-input-row {
        flex-direction: column;
        gap: 10px;
    }
    #manualHandleGroup,
    .dual-input-row .form-group {
        width: 100%;
        margin-right: 0 !important;
    }
}

.form-group {
    margin-bottom: 15px;
}

.form-group:last-child {
    margin-bottom: 0;
}

/* ================ ADD THESE NEW STYLES HERE ================ */
/* Screen Name Field (appears for all platforms) */
#screenName {
    height: 44px; /* Matches other input fields */
}

/* Handle Container (only for FB/Insta) */
#manualHandleGroup {
    margin-top: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

#manualHandleGroup label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
}

#manualHandleGroup input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark);
    font-size: 13px;
}

label i {
    margin-right: 6px;
    color: var(--primary);
    width: 18px;
    text-align: center;
}

input[type="text"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background-color: white;
    font-family: 'Poppins', sans-serif;
    appearance: none;
    -webkit-appearance: none;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

textarea {
    height: 80px;
    resize: vertical;
}

.file-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.upload-btn {
    padding: 8px 12px;
    background-color: var(--light);
    border: 1px dashed #adb5bd;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    font-size: 13px;
}

.upload-btn:hover {
    background-color: #e9ecef;
}

.upload-btn input[type="file"] {
    display: none;
}

.file-name {
    font-size: 12px;
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.preview-container {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.media-item {
    position: relative;
    width: 120px;
    height: 120px;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.media-item .delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    border: none;
}

.media-item:hover .delete-btn {
    opacity: 1;
}

.media-item span {
    display: block;
    font-size: 11px;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

button i {
    font-size: 14px;
}

.btn-primary {
    background-color: #4cc9f0;
    color: rgb(0, 0, 0);
}

.btn-primary:hover {
    background-color: #0ec7ff;
}

.btn-warning {
    background-color: var(--warning);
    color: rgb(0, 0, 0);
}

.btn-danger {
    background-color: var(--danger);
    color: rgb(0, 0, 0);
}

button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.custom-dropdown {
    position: relative;
}

.sub-dropdown {
    margin-left: 15px;
    margin-top: 10px;
    display: none;
}

.has-submenu::after {
    content: " ▼";
    font-size: 0.8em;
}

#priority {
    font-weight: 500;
    border: 1px solid #ddd;
    /* Default color when nothing is selected */
    color: var(--text-color);
}

/* Dropdown options colors */
#priority option[value="high"] {
    color: var(--danger);
}

#priority option[value="medium"] {
    color: var(--warning);
}

#priority option[value="low"] {
    color: var(--success);
}

/* Selected value colors */
#priority.high-priority {
    color: var(--danger);
    border-color: var(--danger);
}

#priority.medium-priority {
    color: var(--warning);
    border-color: var(--warning);
}

#priority.low-priority {
    color: var(--success);
    border-color: var(--success);
}

.notification {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--success);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    opacity: 0;

    transition: all 0.3s ease-in-out, background-color 0.3s ease, color 0.3s ease !important;
}

.notification.show {
    bottom: 20px;
    opacity: 1;
}

.notification i {
    font-size: 18px;
}

@media (max-width: 768px) {
    .glass-container {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    button {
        width: 100%;
    }
}

/* URL Input Container Styles */
.url-input-wrapper {
    display: flex;
    gap: 10px;
    transition: all 0.3s ease;
}

.url-input-wrapper input[type="text"] {
    flex: 1;
    min-width: 0;
}

.handle-container {
    flex: 0.25;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    display: none;
}

.handle-container.visible {
    opacity: 1;
    transform: translateX(0);
    display: block;
}

.handle-container label {
    font-size: 12px;
    margin-bottom: 4px;
}

.handle-container input {
    padding: 8px 10px;
    font-size: 13px;
}

.url-input-wrapper.has-handle #postUrl {
    flex: 0.75;
}

.hidden {
    display: none;
}

.input-error {
    border: 2px solid red !important;
}

.input-warning {
    border: 2px solid #0099ff !important; /* Gold/Yellow border */
    background-color: #addeff !important; /* Light yellow background */
}

.notification.warning {
    background-color: #0099ff;
    color: #000;
}

.url-input-wrapper {
    width: 100%;
}

.input-with-spinner {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

#postUrl {
    flex: 1;
    width: 100%;
    padding-right: 40px; 
    height: 44px; 
}

.spinner {
    position: absolute;
    right: 12px;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    margin-left: -30px; 
    border: 3px solid #ccc;
    border-top: 3px solid #888;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    pointer-events: none; 
}

.spinner.show {
    visibility: visible; 
}

.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(0.7px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: all 0.3s ease;
}

.form-overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: #000000;
}

.big-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}