/* Global Styles */
:root {
    --primary-color: #5865F2;
    --primary-dark: #4752c4;
    --primary-glow: rgba(88, 101, 242, 0.4);
    --secondary-color: #99AAB5;
    --background-dark: #1a1b1e;
    --background-light: #2D2F33;
    --background-lighter: #36393e;
    --text-color: #FFFFFF;
    --text-muted: #99AAB5;
    --success-color: #57F287;
    --error-color: #ED4245;
    --info-color: #5865F2;
    --border-radius: 10px;
    --card-border-color: rgba(255, 255, 255, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.25);
    --transition-speed: 0.3s;
    --menu-item-height: 45px;
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Auth Screen */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: radial-gradient(circle at center, #2f3136 0%, #1a1b1e 100%);
    background-image: url('/api/placeholder/1920/1080');
    background-size: cover;
    background-position: center;
    position: relative;
}

.auth-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(45, 47, 51, 0.8) 0%, rgba(26, 27, 30, 0.95) 100%);
    z-index: 1;
}

.auth-card {
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    padding: 2.5rem;
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.5s ease-out;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8rem;
    font-weight: bold;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(88, 101, 242, 0.5);
    z-index: 1;
}

.logo::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0) 70%);
    top: -25%;
    left: -25%;
    opacity: 0.8;
    animation: shimmer 3s infinite;
}

.logo-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 40%;
    background: var(--primary-color);
    filter: blur(20px);
    opacity: 0.35;
    z-index: 0;
    animation: glowPulse 4s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateY(-10%) translateX(-10%) rotate(0deg);
    }
    50% {
        transform: translateY(-15%) translateX(-5%) rotate(5deg);
    }
    100% {
        transform: translateY(-10%) translateX(-10%) rotate(0deg);
    }
}

.auth-card h2 {
    margin-bottom: 0.8rem;
    font-size: 1.8rem;
}

.auth-card p {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.auth-button i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.auth-button:hover {
    background-color: var(--primary-dark);
}

/* Main App Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    background: linear-gradient(135deg, #20222a 0%, #191b1f 100%);
    position: relative;
    overflow: hidden;
}

.app-container::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url('/api/placeholder/1920/1080');
    background-size: cover;
    background-position: center;
    opacity: 0.05;
    z-index: 0;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(35, 37, 43, 0.8);
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    position: relative;
}

.sidebar-header {
    padding: 1.5rem;
    text-align: center;
}

.app-logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.app-logo::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    top: -25%;
    left: -25%;
    opacity: 0.5;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu .menu-item {
    height: var(--menu-item-height);
    padding: 0 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: all var(--transition-speed);
    position: relative;
    border-radius: 0;
    margin: 2px 0;
}

.sidebar-menu .menu-item span {
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
    transition: transform var(--transition-speed);
    padding-left: 15px;
}

.sidebar-menu .menu-item.active {
    color: var(--text-color);
    background-color: rgba(88, 101, 242, 0.12);
}

.sidebar-menu .menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 75%;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 12px var(--primary-color), 0 0 20px var(--primary-glow);
    animation: glowPulse 2s infinite;
}

.sidebar-menu .menu-item.active span {
    transform: translateX(3px);
}

.sidebar-menu .menu-item i {
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
}

.sidebar-menu .menu-item:hover {
    color: var(--text-color);
    background-color: rgba(88, 101, 242, 0.08);
}

.divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 1.5rem;
}

.sidebar-footer {
    padding: 1.5rem;
}

.logout-button {
    background-color: transparent;
    color: var(--text-muted);
    border: none;
    border-radius: var(--border-radius);
    padding: 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    width: 100%;
}

.logout-button i {
    margin-right: 0.8rem;
}

.logout-button:hover {
    color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    padding: 1.2rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background-color: var(--background-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    flex: 1;
    max-width: 600px;
    position: relative;
}

.search-container i {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.8rem 1rem 0.8rem 3.2rem;
    color: var(--text-color);
    font-size: 0.95rem;
    transition: all var(--transition-speed);
    font-weight: 400;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.07);
}

.search-input::placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

.upload-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.upload-button i {
    margin-right: 0.5rem;
}

.upload-button:hover {
    background-color: var(--primary-dark);
}

.user-info {
    display: flex;
    align-items: center;
    margin-left: 1.5rem;
}

.username {
    margin-right: 0.8rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-color);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

/* Scripts Grid */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeIn 0.5s ease-out;
}

.script-card {
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--card-border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.script-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.script-image {
    height: 160px;
    overflow: hidden;
}

.script-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.script-card:hover .script-image img {
    transform: scale(1.05);
}

.script-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.script-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.script-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.8rem;
    flex: 1;
}

.uploader {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.8;
}

.script-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.8rem;
    border-top: 1px solid var(--card-border-color);
}

.download-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
    cursor: pointer;
    text-decoration: none;
}

.download-button:hover {
    background-color: var(--primary-dark);
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.modal-overlay.hidden {
    pointer-events: none;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
}

.modal-container {
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--card-border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.close-button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.close-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--card-border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.cancel-button {
    background-color: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    border-radius: var(--border-radius);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.cancel-button:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.submit-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.submit-button:hover {
    background-color: var(--primary-dark);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.2rem;
}

.collapsible {
    cursor: pointer;
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    transition: all var(--transition-speed);
    user-select: none;
    position: relative;
    padding-left: 1.5rem;
}

.collapsible::before {
    content: '▸';
    position: absolute;
    left: 0;
    transition: transform var(--transition-speed);
}

.collapsible.active::before {
    transform: rotate(90deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-speed), opacity var(--transition-speed);
    opacity: 0;
}

.collapsible-content.open {
    opacity: 1;
    padding-top: 0.5rem;
}

input[type="text"],
textarea,
select {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 0.8rem 1rem;
    color: var(--text-color);
    font-size: 0.9rem;
    transition: all var(--transition-speed);
    font-family: inherit;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.07);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.upload-alternative {
    text-align: center;
    margin: 1rem 0;
    position: relative;
}

.upload-alternative span {
    display: inline-block;
    padding: 0 1rem;
    background-color: var(--background-light);
    position: relative;
    z-index: 1;
    color: var(--text-muted);
}

.upload-alternative::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
}

.file-upload {
    position: relative;
    text-align: center;
}

.file-upload input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
}

.file-upload label {
    display: block;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 1.2rem;
    text-align: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed);
    position: relative;
    z-index: 0;
}

.file-upload:hover label {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.3);
}

.image-preview {
    margin-top: 1rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    max-height: 200px;
    background-color: rgba(0, 0, 0, 0.1);
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    display: block;
    margin: 0 auto;
}

/* Notification System */
.notification-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: var(--background-light);
    border-left: 4px solid;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.info {
    border-left-color: var(--info-color);
}

.notification-icon {
    margin-right: 12px;
}

.notification.success .notification-icon {
    color: var(--success-color);
}

.notification.error .notification-icon {
    color: var(--error-color);
}

.notification.info .notification-icon {
    color: var(--info-color);
}

.notification-message {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 5px var(--primary-color);
    }
    50% {
        box-shadow: 0 0 10px var(--primary-color);
    }
    100% {
        box-shadow: 0 0 5px var(--primary-color);
    }
}