/* Dashboard Layout */
.social-media-dashboard {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 2rem;
    background: linear-gradient(45deg, var(--text-light), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.new-post-btn, .schedule-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.new-post-btn {
    background: linear-gradient(45deg, var(--button-blue), var(--color-accent));
    color: white;
    border: none;
}

.schedule-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.new-post-btn:hover, .schedule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

/* Calendar Section - Enhanced */
.calendar-section {
    grid-column: span 2;
    background: linear-gradient(180deg, #1e293b, #161f2e);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(45deg, #fff, #a8b1cf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calendar-nav {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.calendar-nav:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.calendar-day {
    position: relative;
    min-height: 120px;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.calendar-day.header {
    min-height: auto;
    padding: 0.75rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    font-size: 0.9rem;
}

.calendar-date {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.calendar-post {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 0.5rem;
}

.calendar-post:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.12));
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.calendar-post-thumbnail {
    width: 100%;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.calendar-post-platforms {
    display: flex;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 0.25rem 0;
}

.calendar-post-platforms i {
    transition: all 0.3s ease;
}

.calendar-post-platforms i:hover {
    color: var(--text-light);
    transform: scale(1.1);
}

.more-info-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(45deg, rgba(var(--button-blue-rgb), 0.2), rgba(var(--button-blue-rgb), 0.3));
    color: var(--button-blue);
    border: 1px solid rgba(var(--button-blue-rgb), 0.3);
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.more-info-btn:hover {
    background: linear-gradient(45deg, rgba(var(--button-blue-rgb), 0.3), rgba(var(--button-blue-rgb), 0.4));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--button-blue-rgb), 0.2);
}

/* Scheduled Posts */
.scheduled-posts {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.post-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1rem;
    align-items: center;
}

.post-media {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.post-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.post-platforms {
    display: flex;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.post-time {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Analytics Overview */
.analytics-overview {
    background: #1e293b;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.metric-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.metric-card i {
    font-size: 1.5rem;
    color: var(--button-blue);
}

.metric-info h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.metric-change {
    font-size: 0.9rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.metric-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.metric-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Modal Styles - Updated */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: #1a2234;
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(45deg, #fff, #a8b1cf);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.modal-actions button {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-draft-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.save-draft-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.close-modal {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.6rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Add a new button for preview */
.preview-btn {
    background: rgba(var(--button-blue-rgb), 0.1);
    color: var(--button-blue);
    border-color: rgba(var(--button-blue-rgb), 0.2);
}

.preview-btn:hover {
    background: rgba(var(--button-blue-rgb), 0.15);
    transform: translateY(-1px);
}

.modal-body {
    padding: 2rem;
}

/* Form Styles - Updated */
.form-group {
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1.1rem;
}

.platform-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.platform-checkbox {
    position: relative;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.platform-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.platform-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    background: transparent;
}

.platform-checkbox input[type="checkbox"]:checked {
    background: var(--button-blue);
    border-color: var(--button-blue);
}

.platform-checkbox input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.platform-checkbox i {
    font-size: 1.2rem;
}

.platform-info {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.media-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.media-upload-area:hover {
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
}

.media-upload-area i {
    font-size: 2.5rem;
    color: var(--button-blue);
    margin-bottom: 1rem;
}

.media-upload-area p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.media-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-media {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.remove-media:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

/* Caption Field Styles */
.caption-container {
    position: relative;
    z-index: 2;
}

textarea[name="caption"] {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
}

textarea[name="caption"]:focus {
    outline: none;
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(var(--button-blue-rgb), 0.1);
}

/* Caption Tools */
.caption-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-top: 0.5rem;
}

.tool-group {
    display: flex;
    gap: 0.5rem;
}

.caption-tools button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.caption-tools button:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

.character-count {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Schedule Type */
.schedule-type {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    position: relative;
    z-index: 2;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    width: 100%;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--button-blue);
}

.radio-option span {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

.schedule-datetime {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

.date-time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.date-input, .time-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-input label, .time-input label {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.schedule-date-input, .schedule-time-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.schedule-date-input:focus, .schedule-time-input:focus {
    outline: none;
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(var(--button-blue-rgb), 0.1);
}

.timezone-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timezone-selector select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 150px;
    transition: all 0.3s ease;
}

.timezone-selector select:focus {
    outline: none;
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(var(--button-blue-rgb), 0.1);
}

/* Form Group Enhancement */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .schedule-type {
        flex-direction: column;
        gap: 1rem;
}

    .radio-option {
        width: 100%;
    }

    .timezone-selector {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
}

    .timezone-selector select {
        width: 100%;
    }
}

/* Post Details Modal - Enhanced */
.post-details-modal .modal-content {
    max-width: 600px;
    background: linear-gradient(180deg, #1e293b, #161f2e);
}

.post-details {
    padding: 2rem;
}

.post-details-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.post-details-image img {
    width: 100%;
    height: auto;
}

.post-details-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-details-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.post-details-platform {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.post-details-platform:hover {
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.12));
    transform: translateY(-1px);
}

.post-details-platform i {
    font-size: 1.2rem;
}

.post-details-caption {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    white-space: pre-wrap;
    line-height: 1.6;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.post-details-hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.hashtag {
    background: linear-gradient(45deg, rgba(var(--button-blue-rgb), 0.1), rgba(var(--button-blue-rgb), 0.2));
    color: var(--button-blue);
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(var(--button-blue-rgb), 0.2);
    transition: all 0.3s ease;
}

.hashtag:hover {
    background: linear-gradient(45deg, rgba(var(--button-blue-rgb), 0.2), rgba(var(--button-blue-rgb), 0.3));
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(var(--button-blue-rgb), 0.1);
}

/* Empty State - New */
.calendar-day.empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.02);
}

/* Loading State - New */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--button-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Media Cropper Styles */
.cropper-container {
    max-height: 400px;
    margin: 20px 0;
}

.cropper-view-box,
.cropper-face {
    border-radius: 0;
}

/* Platform-specific Preview */
.platform-preview {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f8f9fa;
}

.platform-preview-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.platform-preview-header i {
    margin-right: 8px;
    font-size: 1.2em;
}

.platform-preview-content {
    font-size: 0.9em;
    line-height: 1.4;
}

/* Engagement Metrics */
.post-metrics {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 5px;
}

.metric i {
    color: #666;
}

.metric span {
    font-weight: 500;
}

/* Character Count */
.character-count {
    font-size: 0.8em;
    color: #666;
    margin-left: auto;
}

.character-count.exceeded {
    color: #dc3545;
}

/* Post Preview Card */
.post-preview-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 15px 0;
    overflow: hidden;
}

.post-preview-header {
    padding: 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.post-preview-content {
    padding: 15px;
}

.post-preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.post-preview-caption {
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Platform Icons */
.platform-icons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.platform-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f0f0f0;
}

.platform-icon i {
    font-size: 0.8em;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .post-metrics {
        flex-wrap: wrap;
    }
    
    .metric {
        flex: 1 1 40%;
    }
    
    .cropper-container {
        max-height: 300px;
    }
    
    .platform-preview {
        margin: 10px 0;
        padding: 10px;
    }

    .modal-actions {
        gap: 0.5rem;
    }

    .modal-actions button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .close-modal {
        width: 32px;
        height: 32px;
        padding: 0.5rem;
    }
}

/* Form Tabs - New Design */
.form-tabs {
    position: relative;
    margin: 0 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-nav {
    display: flex;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.tab-btn {
    position: relative;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
}

.tab-btn i {
    font-size: 1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--text-light);
    background: rgba(var(--button-blue-rgb), 0.1);
}

.tab-btn.active i {
    opacity: 1;
    color: var(--button-blue);
}

.tab-indicator {
    position: absolute;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--button-blue);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Tab Content Styles */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

/* Create Tab Content */
#create-tab {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Schedule Tab Content */
#schedule-tab {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Preview Tab Content */
#preview-tab {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Form Group Enhancement */
.form-group {
    margin-bottom: 1.5rem;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.form-group.hidden {
    display: none;
    opacity: 0;
}

/* Schedule Type Styles */
.schedule-type {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    width: 100%;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--button-blue);
}

.radio-option span {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Schedule Datetime Styles */
.schedule-datetime {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
}

.date-time-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.date-input, .time-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-input label, .time-input label {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.schedule-date-input, .schedule-time-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-light);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.schedule-date-input:focus, .schedule-time-input:focus {
    outline: none;
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 2px rgba(var(--button-blue-rgb), 0.1);
}

/* Preview Tab Styles */
.preview-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.preview-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Form Actions */
.form-actions {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.schedule-post-btn {
    background: linear-gradient(45deg, var(--button-blue), var(--color-accent));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.schedule-post-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(var(--button-blue-rgb), 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .date-time-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .action-buttons {
        width: 100%;
    }

    .schedule-post-btn {
        width: 100%;
    }
}

/* Modal Header Enhancement */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.modal-actions button {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-draft-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.save-draft-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.close-modal {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.6rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-tabs {
        margin: 0 1rem;
    }

    .tab-nav {
        gap: 0.5rem;
    }

    .tab-btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    .tab-btn i {
        font-size: 0.9rem;
    }

    .modal-actions {
        gap: 0.5rem;
    }

    .modal-actions button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .close-modal {
        width: 32px;
        height: 32px;
        padding: 0.5rem;
    }
}

/* Platform Checkboxes Enhancement */
.platform-checkbox {
    position: relative;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.platform-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.platform-info {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Media Upload Enhancement */
.upload-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

/* Caption Tools Enhancement */
.caption-container {
    position: relative;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.caption-tools {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    margin-top: 0.5rem;
}

/* Schedule Tab Styles */
.schedule-type {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--button-blue);
}

.schedule-datetime {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.timezone-selector {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timezone-selector select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.5rem;
    border-radius: 6px;
    min-width: 150px;
}

/* Preview Tab Styles */
.preview-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
}

.preview-platforms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Form Actions Enhancement */
.form-actions {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cancel-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-tabs {
        padding: 0.4rem 0.75rem;
        gap: 0.2rem;
    }

    .tab-btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    .tab-btn i {
        font-size: 0.8rem;
    }

    .schedule-type {
        flex-direction: column;
        gap: 1rem;
    }

    .form-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .action-buttons {
        width: 100%;
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
}

/* Action Buttons Section */
.action-buttons-section {
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 0.5rem;
}

/* Image Upload Section */
#imageUploadSection {
    margin-bottom: 1.5rem;
}

.media-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.media-upload-area:hover {
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
}

.media-upload-area i {
    font-size: 2.5rem;
    color: var(--button-blue);
    margin-bottom: 1rem;
}

.media-upload-area p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.upload-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Image Preview Section */
#imagePreviewSection {
    margin-bottom: 2rem;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.media-preview-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.media-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-media {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.remove-media:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

/* Form Group Enhancement */
.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 1rem;
    color: var(--text-light);
    font-weight: 500;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .action-buttons-section {
        margin-bottom: 1rem;
    }

    .media-upload-area {
        padding: 1.5rem;
    }

    .media-upload-area i {
        font-size: 2rem;
    }

    .media-preview {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .remove-media {
        width: 24px;
        height: 24px;
    }
}

/* Modal Layout */
.modal-layout {
    display: flex;
    gap: 2rem;
    min-height: 600px;
    position: relative;
}

/* Vertical Tabs */
.vertical-tabs {
    width: 200px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    z-index: 2;
}

.tab-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 8px;
    text-align: left;
}

.tab-btn i {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: all 0.3s ease;
    width: 20px;
    text-align: center;
}

.tab-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active {
    color: var(--text-light);
    background: rgba(var(--button-blue-rgb), 0.1);
    border-left: 3px solid var(--button-blue);
}

.tab-btn.active i {
    opacity: 1;
    color: var(--button-blue);
}

/* Content Area */
.content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    position: relative;
    z-index: 1;
}

/* Tab Content */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 1;
}

.tab-content.active {
    display: block;
    opacity: 1;
}

/* Image Upload Section */
#imageUploadSection {
    margin-bottom: 1.5rem;
}

.media-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.media-upload-area:hover {
    border-color: var(--button-blue);
    background: rgba(255, 255, 255, 0.05);
}

.media-upload-area i {
    font-size: 2.5rem;
    color: var(--button-blue);
    margin-bottom: 1rem;
}

.media-upload-area p {
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.upload-hint {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Image Preview Section */
#imagePreviewSection {
    margin-bottom: 2rem;
}

.media-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Form Actions */
.form-actions {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .vertical-tabs {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 0.5rem;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
        white-space: nowrap;
    }

    .tab-btn.active {
        border-left: none;
        border-bottom: 3px solid var(--button-blue);
    }

    .content-area {
        min-height: 400px;
    }
}

/* Emoji Picker Styles */
.emoji-picker {
    position: absolute;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    width: 300px;
    padding: 1rem;
}

.emoji-picker-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.emoji-categories {
    display: flex;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.emoji-categories button {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.emoji-categories button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.emoji-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.5rem;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
}

.emoji-list button {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.emoji-list button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

/* Media Upload Enhancement */
.media-upload-area.dragover {
    border-color: var(--button-blue);
    background: rgba(var(--button-blue-rgb), 0.1);
}

/* Button States */
button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

button.loading {
    position: relative;
    color: transparent !important;
}

button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Alert Messages */
.alert-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

.alert-message.error {
    background: rgba(239, 68, 68, 0.9);
}

.alert-message.success {
    background: rgba(16, 185, 129, 0.9);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Form Validation Styles */
.form-group.error input,
.form-group.error textarea {
    border-color: #ef4444;
}

.form-group.error .error-message {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Platform Checkbox Enhancement */
.platform-checkbox input[type="checkbox"]:checked + i {
    color: var(--button-blue);
}

/* Schedule Date Input Enhancement */
.schedule-date-input:focus {
    border-color: var(--button-blue);
    box-shadow: 0 0 0 2px rgba(var(--button-blue-rgb), 0.1);
}

/* Action Buttons Enhancement */
.action-buttons {
    display: flex;
    gap: 1rem;
}

.action-buttons button {
    min-width: 120px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .emoji-picker {
        width: 100%;
        max-width: 300px;
        left: 50%;
        transform: translateX(-50%);
    }

    .emoji-list {
        grid-template-columns: repeat(6, 1fr);
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons button {
        width: 100%;
    }
} 