/* Admin Panel Styles with Enhanced Animations */
:root {
    --primary-color: #ff0000;
    --secondary-color: #282828;
    --background-color: #1a1a1a;
    --card-background: #2d2d2d;
    --text-color: #ffffff;
    --border-color: #444;
    --success-color: #4caf50;
    --error-color: #f44336;
    --hover-color: #ff4444;
    --transition-speed: 0.3s;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all var(--transition-speed) ease;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
                url('../images/header-bg.jpg') center/cover;
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-box {
    background-color: var(--card-background);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.login-header p {
    color: #888;
}

.login-message {
    margin-top: 15px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
}

.login-message.error {
    background-color: var(--error-color);
    color: white;
}

/* Dashboard Layout */
.dashboard-page {
    display: flex;
}

.sidebar {
    width: 250px;
    height: 100vh;
    background-color: var(--secondary-color);
    position: fixed;
    padding: 20px 0;
}

.content {
    flex: 1;
    margin-left: 250px;
    padding: 30px;
}

/* Navigation */
.logo {
    display: flex;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 30px;
}

.logo i {
    font-size: 24px;
    color: var(--primary-color);
    margin-right: 10px;
}

.logo span {
    font-size: 20px;
    font-weight: bold;
}

.nav-links {
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.nav-links a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.nav-links a:hover,
.nav-links a.active {
    background-color: var(--primary-color);
}

/* Section Styles */
.section {
    display: none;
}

.section.active {
    display: block;
}

.section h1 {
    margin-bottom: 30px;
    font-size: 24px;
    display: flex;
    align-items: center;
}

.section h1 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.stat-card i {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.stat-card h3 {
    margin-bottom: 10px;
    font-size: 16px;
    color: #888;
}

.stat-card p {
    font-size: 24px;
    font-weight: bold;
}

/* Theme Management */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.theme-card {
    background-color: var(--card-background);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.theme-preview {
    height: 150px;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow: hidden;
}

.theme-preview.dark {
    background-color: #1a1a1a;
}

.theme-preview.light {
    background-color: #ffffff;
}

.theme-preview.custom {
    background: linear-gradient(45deg, var(--primary-color), var(--hover-color));
}

.preview-header {
    height: 30%;
    background-color: rgba(255, 255, 255, 0.1);
}

.preview-content {
    height: 70%;
    padding: 10px;
}

/* Quick Actions */
.quick-actions {
    margin-top: 30px;
    background: var(--card-background);
    padding: 20px;
    border-radius: 10px;
    animation: slideUp 0.5s ease;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.action-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--hover-color));
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 0, 0, 0.3);
}

/* Tools Manager */
.tools-manager {
    background: var(--card-background);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
}

.tools-list {
    margin-top: 20px;
    display: grid;
    gap: 20px;
}

.tool-item {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 15px;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.tool-item .tool-info {
    display: grid;
    gap: 10px;
}

.tool-item .tool-actions {
    display: flex;
    gap: 10px;
}

/* Ad Slots Grid */
.ad-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.ad-slot {
    background: var(--secondary-color);
    padding: 20px;
    border-radius: 8px;
    position: relative;
    transform: translateY(0);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-slot:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.ad-slot .size-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
}

/* Code Editor */
.code-wrapper {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    position: relative;
}

.code-wrapper pre {
    margin: 0;
    white-space: pre-wrap;
}

.code-wrapper code {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
}

/* Enhanced Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Message Animations */
.message {
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Responsive Enhancements */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .content {
        margin-left: 70px;
    }

    .logo span,
    .nav-links a span {
        display: none;
    }

    .nav-links a {
        justify-content: center;
    }

    .nav-links a i {
        margin: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .theme-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        grid-template-columns: 1fr;
    }

    .ad-slots-grid {
        grid-template-columns: 1fr;
    }

    .tool-item {
        grid-template-columns: 1fr;
    }

    .tool-item .tool-actions {
        justify-content: flex-start;
    }
}
