/* Events section positioning */
.events {
    position: relative;
}

/* Events Settings Button */
.events-settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.events-settings-btn:hover {
    border-color: #814ac8;
    background: rgba(129, 74, 200, 0.3);
}

.events-settings-btn svg {
    width: 20px;
    height: 20px;
}

/* Events Settings Dialog */
.events-dialog {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.events-dialog.active {
    display: flex;
    opacity: 1;
}

.events-dialog-content {
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    width: 90vw;
    height: 90vh;
    position: relative;
    animation: slideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Dialog Header */
.events-dialog-header {
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    position: relative;
}

.events-close {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.events-close:hover {
    transform: translateY(-50%) rotate(90deg);
}

.events-title-dialog {
    font-size: 16px;
    font-weight: 500;
    margin: 0;
    text-align: left;
    color: #fff;
    letter-spacing: 0.5px;
}

/* Tabs */
.events-tabs {
    flex-shrink: 0;
    padding: 0 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

.events-tabs .tab-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
}

.events-tabs .tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.events-tabs .tab-btn.active {
    color: #814ac8;
    border-bottom-color: #814ac8;
}

/* Dialog Body */
.events-dialog-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 74, 200, 0.5) rgba(255, 255, 255, 0.1);
}

.events-dialog-body::-webkit-scrollbar {
    width: 6px;
}

.events-dialog-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.events-dialog-body::-webkit-scrollbar-thumb {
    background: rgba(129, 74, 200, 0.5);
    border-radius: 0;
}

.events-dialog-body::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 74, 200, 0.8);
}

/* Dialog Footer */
.events-dialog-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    background: #000;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.events-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    align-items: center;
}

/* Form */
.events-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.events-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 25px;
}

.events-form .form-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    align-items: start;
}

.events-form .form-row.cols-1 {
    grid-template-columns: 1fr;
}

.events-form .form-row.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.events-form .form-row.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.events-form .form-group.full-width {
    grid-column: 1 / -1;
}

.events-form .form-row .form-group {
    margin-bottom: 0;
}

.events-form .form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 400;
}

.events-form .form-group small {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.events-form .form-group input[type="text"],
.events-form .form-group input[type="number"],
.events-form .form-group select,
.events-form .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.events-form .form-group input[type="text"],
.events-form .form-group input[type="number"],
.events-form .form-group select {
    height: 38px;
}

.events-form .form-group input:focus,
.events-form .form-group select:focus,
.events-form .form-group textarea:focus {
    outline: none;
    border-color: #814ac8;
    background: rgba(255, 255, 255, 0.05);
}

/* Color Picker */
.color-picker-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.color-picker-input {
    width: 50px;
    max-width: 50px;
    min-width: 50px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    cursor: pointer;
}

.color-text-input {
    flex: 1;
    font-family: monospace;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Errors and Success */
.events-error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 0;
    padding: 10px 12px;
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
}

.events-success {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 0;
    padding: 10px 12px;
    color: #6bff6b;
    font-size: 13px;
    text-align: center;
}

/* Buttons */
.btn-events-dialog {
    padding: 8px 16px;
    background: #814ac8;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    white-space: nowrap;
}

.btn-events-dialog:hover {
    background: #9b66d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(129, 74, 200, 0.3);
}

.btn-events-dialog:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-events-dialog-secondary {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    white-space: nowrap;
}

.btn-events-dialog-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Gradient Direction Grid */
.gradient-direction-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.gradient-direction-option {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gradient-direction-option input[type="radio"] {
    display: none;
}

.gradient-direction-preview {
    width: 60px;
    height: 60px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.gradient-direction-option:has(input:checked) .gradient-direction-preview {
    border-color: #814ac8;
    box-shadow: 0 0 10px rgba(129, 74, 200, 0.3);
}

.gradient-direction-preview[data-direction="0deg"] {
    background: linear-gradient(0deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="45deg"] {
    background: linear-gradient(45deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="90deg"] {
    background: linear-gradient(90deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="135deg"] {
    background: linear-gradient(135deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="149deg"] {
    background: linear-gradient(149deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="180deg"] {
    background: linear-gradient(180deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="225deg"] {
    background: linear-gradient(225deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="270deg"] {
    background: linear-gradient(270deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="315deg"] {
    background: linear-gradient(315deg, #ff2a70, #0d0d0d);
}

.gradient-direction-preview[data-direction="radial"] {
    background: radial-gradient(circle, #ff2a70, #0d0d0d);
}

.gradient-direction-option span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Gradient Settings Layout */
.gradient-settings-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.gradient-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gradient-stop {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
}

.gradient-stop > label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

/* Gradient Preview */
.gradient-preview-container {
    position: sticky;
    top: 0;
}

.gradient-preview-container > label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.events-gradient-preview {
    width: 100%;
    height: 200px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Range Input */
input[type="range"] {
    width: 100%;
    accent-color: #814ac8;
}

output {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(129, 74, 200, 0.1);
    color: #814ac8;
    font-weight: 500;
    margin-top: 5px;
    font-size: 12px;
}

/* Cards Grid Container */
.cards-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.card-editor {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0;
}

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

.card-editor-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

.card-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-toggle label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

.card-editor-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card-image-upload {
    position: relative;
    cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    min-height: 200px;
}

.card-image-upload:hover {
    border-color: #814ac8;
    background: rgba(129, 74, 200, 0.05);
}

.card-image-upload input[type="file"] {
    display: none;
}

.card-image-placeholder {
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.card-image-upload.has-image .card-image-placeholder {
    display: none;
}

.card-image-placeholder svg {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
}

.card-image-placeholder p {
    margin: 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
}

.card-image-preview {
    display: none;
    position: relative;
}

.card-image-upload.has-image .card-image-preview {
    display: block;
}

.card-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.card-image-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.card-image-remove:hover {
    background: #ff2a70;
}

.card-editor-body input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
    height: 38px;
}

.card-editor-body input[type="text"]:focus {
    outline: none;
    border-color: #814ac8;
    background: rgba(255, 255, 255, 0.05);
}

.card-editor-body textarea {
    width: 100%;
    min-height: 80px;
    resize: vertical;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #fff;
    font-size: 14px;
    font-family: Figtree, "Figtree Placeholder", sans-serif;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.card-editor-body textarea:focus {
    outline: none;
    border-color: #814ac8;
    background: rgba(255, 255, 255, 0.05);
}

/* Option Groups */
.option-group {
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.option-header {
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-label span {
    user-select: none;
}

/* Responsive */
@media (max-width: 1200px) {
    .events-form .form-row {
        grid-template-columns: repeat(3, 1fr);
    }

    .cards-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .events-form .form-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .gradient-settings-layout {
        grid-template-columns: 1fr;
    }

    .gradient-preview-container {
        position: static;
    }

    .gradient-direction-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cards-grid-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .events-dialog-content {
        width: 95vw;
        height: 95vh;
    }

    .events-dialog-header {
        padding: 15px 20px;
    }

    .events-close {
        right: 15px;
    }

    .events-title-dialog {
        font-size: 15px;
    }

    .events-tabs {
        padding: 0 20px;
    }

    .events-dialog-body {
        padding: 20px;
    }

    .events-dialog-footer {
        padding: 15px 20px;
    }

    .events-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-events-dialog,
    .btn-events-dialog-secondary {
        width: 100%;
    }

    .color-picker-input {
        height: 36px;
    }
}

@media (max-width: 600px) {
    .events-form .form-row {
        grid-template-columns: 1fr;
    }

    .gradient-direction-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
