/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.logo-image {
    width: 40px !important;
    height: 40px !important;
    margin-right: 10px !important;
    object-fit: contain !important;
}
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
    min-height: 100vh;
}

/* Logo Styles */
.logo-icon {
    position: relative;
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.popcorn {
    position: absolute;
    left: 0;
    top: 0;
}

.popcorn-top {
    width: 20px;
    height: 15px;
    background: #1e40af;
    border-radius: 50% 50% 0 0;
    position: relative;
}

    .popcorn-top::before {
        content: '';
        position: absolute;
        width: 8px;
        height: 8px;
        background: #1e40af;
        border-radius: 50%;
        top: -4px;
        left: 2px;
    }

    .popcorn-top::after {
        content: '';
        position: absolute;
        width: 6px;
        height: 6px;
        background: #1e40af;
        border-radius: 50%;
        top: -3px;
        right: 3px;
    }

.popcorn-bottom {
    width: 16px;
    height: 20px;
    background: #1e40af;
    margin-top: 15px;
    border-radius: 0 0 8px 8px;
    position: relative;
}

    .popcorn-bottom::before {
        content: '';
        position: absolute;
        width: 12px;
        height: 3px;
        background: #1e40af;
        top: 5px;
        left: 2px;
        border-radius: 2px;
    }

    .popcorn-bottom::after {
        content: '';
        position: absolute;
        width: 12px;
        height: 3px;
        background: #1e40af;
        bottom: 5px;
        left: 2px;
        border-radius: 2px;
    }

.microscope {
    position: absolute;
    right: 0;
    top: 5px;
}

.scope-body {
    width: 4px;
    height: 25px;
    background: #1e40af;
    position: relative;
    transform: rotate(45deg);
}

.scope-eye {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #1e40af;
    border-radius: 50%;
    top: -8px;
    left: -2px;
}

    .scope-eye::before {
        content: '';
        position: absolute;
        width: 4px;
        height: 4px;
        background: white;
        border-radius: 50%;
        top: 2px;
        left: 2px;
    }

.scope-lens {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #1e40af;
    border-radius: 50%;
    bottom: -8px;
    right: -2px;
}

    .scope-lens::before {
        content: '';
        position: absolute;
        width: 4px;
        height: 4px;
        background: white;
        border-radius: 50%;
        top: 2px;
        left: 2px;
    }

/* Dashboard Header */
.dashboard-header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-nav {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: #1e40af;
}

.logo-text {
    font-size: 28px;
    font-weight: 900;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 30px;
}

.coins-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fef3c7;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 700;
    color: #92400e;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.2);
    animation: coinBounce;
    animation-duration: 0.6s;
}

    .coins-display i {
        color: #f59e0b;
        font-size: 1.2rem;
    }

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

    .user-profile span {
        font-weight: 600;
        color: #1e293b;
    }

.btn-home, .btn-logout {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-home {
    background: #1e40af;
    color: white;
}

    .btn-home:hover {
        background: #1d4ed8;
        transform: translateY(-2px);
    }

.btn-logout {
    background: #ef4444;
    color: white;
}

    .btn-logout:hover {
        background: #dc2626;
        transform: translateY(-2px);
    }

/* Dashboard Content */
.dashboard-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    padding-top: 30px;
    min-height: calc(100vh - 120px);
}

/* Sidebar */
.dashboard-sidebar {
    background: white;
    border-radius: 15px;
    padding: 30px 0;
    height: fit-content;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    position: sticky;
    top: 120px;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 30px;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    cursor: pointer;
}

    .menu-item:hover {
        background: #f1f5f9;
        color: #1e40af;
        border-left-color: #1e40af;
    }

    .menu-item.active {
        background: #eff6ff;
        color: #1e40af;
        border-left-color: #1e40af;
        font-weight: 600;
    }

    .menu-item i {
        width: 20px;
        text-align: center;
    }

/* Main Content */
.dashboard-main {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.section-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes coinBounce {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.section-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

    .section-header h2 {
        font-size: 2rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 10px;
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .section-header p {
        color: #64748b;
        font-size: 1.1rem;
    }

/* Forms */
.create-form {
    max-width: 700px;
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 25px;
}

    .form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 600;
        color: #1e293b;
        font-size: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        padding: 15px 20px;
        border: 2px solid #e2e8f0;
        border-radius: 12px;
        font-size: 1rem;
        transition: all 0.3s;
        background: #fafbfc;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: #1e40af;
            background: white;
            box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
        }

    .form-group textarea {
        resize: vertical;
        min-height: 120px;
    }

.cost-info {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 15px 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #92400e;
    font-weight: 600;
    font-size: 1.1rem;
    border: 1px solid #f59e0b;
}

    .cost-info i {
        color: #f59e0b;
        font-size: 1.3rem;
    }

/* Buttons */
.btn-create {
    background: linear-gradient(135deg, #1e40af, #3b82f6);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
}

    .btn-create:hover:not(:disabled) {
        transform: translateY(-3px);
        box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
    }

    .btn-create:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    max-width: 350px;
    word-wrap: break-word;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

    .notification.show {
        transform: translateX(0);
    }

.notification-success {
    background: #10b981;
}

.notification-error {
    background: #ef4444;
}

.notification-warning {
    background: #f59e0b;
}

.notification-info {
    background: #1e40af;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Result Area */
.result-area {
    margin-top: 40px;
    padding: 30px;
    background: #f8fafc;
    border-radius: 15px;
    border: 2px solid #e2e8f0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

    .result-header h3 {
        font-size: 1.5rem;
        font-weight: 700;
        color: #1e293b;
    }

.result-actions {
    display: flex;
    gap: 12px;
}

.btn-save, .btn-regenerate {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.btn-save {
    background: #10b981;
    color: white;
}

    .btn-save:hover {
        background: #059669;
        transform: translateY(-2px);
    }

.btn-regenerate {
    background: #f59e0b;
    color: white;
}

    .btn-regenerate:hover {
        background: #d97706;
        transform: translateY(-2px);
    }

/* Story Content */
.story-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    line-height: 1.8;
    color: #374151;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-size: 1.1rem;
}

    .story-content h3 {
        color: #1e40af;
        font-size: 1.8rem;
        margin-bottom: 20px;
        text-align: center;
    }

    .story-content p {
        margin-bottom: 15px;
        text-indent: 2rem;
    }

/* Loading */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-sidebar {
        order: 2;
        position: static;
    }

    .dashboard-main {
        order: 1;
        padding: 30px;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding: 0 20px;
    }

    .menu-item {
        white-space: nowrap;
        border-left: none;
        border-bottom: 4px solid transparent;
        padding: 15px 25px;
        border-radius: 10px 10px 0 0;
    }

        .menu-item:hover,
        .menu-item.active {
            border-left: none;
            border-bottom-color: #1e40af;
        }
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 20px;
    }

    .section-header h2 {
        font-size: 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .create-form {
        max-width: 100%;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .dashboard-nav {
        padding: 0 15px;
    }

    .dashboard-content {
        padding: 0 15px;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
    }

    .btn-create {
        width: 100%;
        justify-content: center;
    }
}
.animate-bounce {
    animation: coinBounce 0.6s ease-in-out;
}

@keyframes coinBounce {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Loading animation */
.loading-container {
    text-align: center;
    padding: 60px 20px;
}

.loading-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* Additional styles for better compatibility */
.story-content {
    background: white;
    padding: 40px;
    border-radius: 12px;
    line-height: 1.8;
    color: #374151;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-size: 1.1rem;
}

    .story-content h3 {
        color: #1e40af;
        font-size: 1.8rem;
        margin-bottom: 20px;
        text-align: center;
    }

    .story-content p {
        margin-bottom: 15px;
        text-indent: 2rem;
    }

.generated-image {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}