/* Body light theme */
body.light-theme {
    background-color: #ffffff;
    color: #3a3a3a;
}

/* Page title styling */
h1 {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 2rem;

    color: #4ec9b0;
    font-size: 2rem;
}

/* Shared section styling */
.crud-form-section,
.projects-list-section,
.controls {
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

body.light-theme .crud-form-section,
body.light-theme .projects-list-section,
body.light-theme .controls {
    background: #f5f5f5;
    border-color: #d4d4d4;
}

/* Section headings */
h2 {
    color: #4ec9b0;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}

/* Controls section */
.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.controls-label {
    color: #4ec9b0;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Button styles */
.btn {
    padding: 0.6rem 1.2rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 600;

    background: #1e1e1e;
    color: #4ec9b0;
    border: 2px solid #4ec9b0;
    border-radius: 4px;

    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #4ec9b0;
    color: #1e1e1e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 201, 176, 0.3);
}

.btn:active {
    transform: translateY(0);
}

body.light-theme .btn {
    background: #ffffff;
    color: #569cd6;
    border-color: #569cd6;
}

body.light-theme .btn:hover {
    background: #569cd6;
    color: #ffffff;
}

/* Button variants */
.btn-primary {
    background: #4ec9b0;
    color: #1e1e1e;
}

.btn-primary:hover {
    background: #6edcc4;
    border-color: #6edcc4;
}

.btn-secondary {
    background: transparent;
    color: #d4d4d4;
    border: 2px solid #3e3e42;
}

.btn-secondary:hover {
    background: #3e3e42;
}

body.light-theme .btn-secondary {
    color: #3a3a3a;
    border-color: #d4d4d4;
}

body.light-theme .btn-secondary:hover {
    background: #d4d4d4;
}

.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

/* Message styles */
.message {
    padding: 1rem 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    border-left: 4px solid;
}

.message-success {
    background: #2d4a2f;
    border-left-color: #4ec9b0;
    color: #4ec9b0;
}

.message-error {
    background: #4a2d2d;
    border-left-color: #f48771;
    color: #f48771;
}

.message-info {
    background: #2d3a4a;
    border-left-color: #569cd6;
    color: #569cd6;
}

body.light-theme .message-success {
    background: #e8f5e9;
    color: #2e7d32;
}

body.light-theme .message-error {
    background: #ffebee;
    color: #c62828;
}

body.light-theme .message-info {
    background: #e3f2fd;
    color: #1976d2;
}

/* Loading indicator */
.loading-container {
    padding: 3rem;
    text-align: center;
}

.loading-bar-wrapper {
    width: 100%;
    max-width: 400px;
    height: 4px;
    background: #3e3e42;
    border-radius: 2px;
    margin: 0 auto 1rem;
    overflow: hidden;
}

body.light-theme .loading-bar-wrapper {
    background: #d4d4d4;
}

.loading-bar {
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, #4ec9b0, #569cd6);
    border-radius: 2px;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(350%);
    }
    100% {
        transform: translateX(-100%);
    }
}

.loading-text {
    color: #4ec9b0;
    font-size: 0.9rem;
}

/* Error container */
.error-container {
    padding: 2rem;
    text-align: center;
    background: #2d2d30;
    border: 1px solid #f48771;
    border-radius: 6px;
}

body.light-theme .error-container {
    background: #fff0f0;
    border-color: #d32f2f;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message {
    color: #f48771;
    font-size: 0.9rem;
    line-height: 1.6;
}

body.light-theme .error-message {
    color: #d32f2f;
}

/* Projects container */
#projects-container {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Animation styling */
project-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

project-card:nth-child(2) {
    animation-delay: 0.1s;
}

project-card:nth-child(3) {
    animation-delay: 0.2s;
}

project-card:nth-child(4) {
    animation-delay: 0.3s;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #858585;
}

.empty-state p {
    margin-bottom: 0.5rem;
}

/* Responsive styles */
@media (max-width: 768px) {
    h1 {
        font-size: 1.5rem;
        padding-left: 1.5rem;
    }

    .controls,
    .crud-form-section,
    .projects-list-section {
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.3rem;
        padding-left: 1rem;
    }

    .controls,
    .crud-form-section,
    .projects-list-section {
        padding: 1rem;
    }

    .btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
}
