:root {
    --primary-color: #4facfe;
    --secondary-color: #00f2fe;
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-color: #ffffff;
    --card-hover-transform: translateY(-10px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--text-color);
    background: url('background.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Darkens background image */
    z-index: -1;
}

.container {
    width: 90%;
    max-width: 1200px;
    padding: 2rem;
    text-align: center;
}

header {
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.reset-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 107, 107, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.reset-btn:hover {
    background: rgba(255, 107, 107, 0.8);
    color: white;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.4);
    transform: translateY(-2px);
}

.manual-btn {
    position: fixed;
    bottom: 20px;
    right: 140px;
    /* Positioned to the left of the reset button */
    background: rgba(79, 172, 254, 0.2);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(79, 172, 254, 0.3);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    z-index: 100;
}

.manual-btn:hover {
    background: rgba(79, 172, 254, 0.8);
    color: white;
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.4);
    transform: translateY(-2px);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    perspective: 1000px;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

.card:hover {
    transform: var(--card-hover-transform);
    box-shadow: 0 15px 40px rgba(0, 242, 254, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.card-image {
    height: 200px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    /* Hidden by default for logic simplicity, managed by .locked class */
    transition: opacity 0.3s ease;
}

.card.locked .lock-overlay {
    opacity: 1;
}

.lock-overlay i {
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Locked State styling */
.card.locked {
    filter: grayscale(80%);
}

.card.locked:hover {
    filter: grayscale(80%);
    /* Keep grayscale on hover */
    transform: none;
    /* Optional: also prevent movement if desired to feel 'disabled' */
    cursor: not-allowed;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    text-align: left;
}

.card-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.card-content p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #e0e0e0;
}

.card-action {
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.card-action i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.card:hover .card-action i {
    transform: translateX(5px);
}

.card.locked:hover .card-action i {
    transform: none;
    /* Don't move lock icon */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    color: white;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--secondary-color);
}

.modal-content h2 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    outline: none;
    transition: border-color 0.3s;
}

.modal-content input:focus {
    border-color: var(--primary-color);
}

.modal-content button {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
}

.modal-content button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 242, 254, 0.4);
}

.error-msg {
    color: #ff6b6b;
    margin-top: 1rem;
    font-size: 0.9rem;
    display: none;
    /* Hidden by default */
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

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

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    50% {
        transform: translateX(10px);
    }

    75% {
        transform: translateX(-10px);
    }

    100% {
        transform: translateX(0);
    }
}

/* Response Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .container {
        padding: 1rem;
    }
}