/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Caveat', cursive;
    padding: 20px;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* Animated background orbs */
body::before,
body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

body::before {
    width: 400px;
    height: 400px;
    background: rgba(255, 200, 100, 0.15);
    top: -100px;
    left: -100px;
}

body::after {
    width: 500px;
    height: 500px;
    background: rgba(255, 150, 100, 0.1);
    bottom: -150px;
    right: -150px;
    animation-delay: -10s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, 30px) scale(1.1);
    }
}

/* ==================== LOGIN SCREEN ==================== */

.login-screen {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 50px 40px;
    text-align: center;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    font-size: 3.5rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
    text-shadow: 0 4px 20px rgba(255, 200, 100, 0.3);
}

.login-subtitle {
    font-size: 1.4rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 40px;
}

.google-login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    font-size: 1.2rem;
    font-family: 'Caveat', cursive;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.google-login-btn:hover {
    background: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

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

.google-login-btn svg {
    flex-shrink: 0;
}

/* ==================== APP SCREEN ==================== */

.app-screen {
    min-height: 100vh;
}

/* App Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    gap: 15px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-header h1 {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.user-name {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.logout-btn {
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255, 100, 100, 0.4);
    transform: scale(1.1);
}

.add-note-btn {
    padding: 10px 20px;
    font-size: 1.1rem;
    font-family: 'Caveat', cursive;
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.3), rgba(255, 180, 80, 0.2));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 200, 100, 0.3);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(255, 180, 80, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.add-note-btn:hover {
    background: linear-gradient(135deg, rgba(255, 200, 100, 0.5), rgba(255, 180, 80, 0.4));
    transform: translateY(-2px);
}

/* Notes Container */
.notes-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: center;
    padding: 20px 0;
}

/* Glassmorphic Post-It Note */
.postit {
    background: linear-gradient(145deg,
            rgba(255, 235, 150, 0.88) 0%,
            rgba(255, 220, 100, 0.8) 50%,
            rgba(255, 200, 80, 0.85) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 320px;
    min-height: 350px;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.5),
        inset 0 -20px 40px rgba(0, 0, 0, 0.05);
    position: relative;
    transform: rotate(-1deg);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.postit:nth-child(even) {
    transform: rotate(1deg);
}

.postit:nth-child(3n) {
    transform: rotate(-2deg);
}

/* Tape effect */
.postit::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 25px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.postit:hover {
    transform: rotate(0deg) scale(1.02) translateY(-5px);
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.5);
}

/* Animations */
.postit.tearing {
    animation: tearOff 0.6s ease-out forwards;
}

.postit.appearing {
    animation: slideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes tearOff {
    0% {
        transform: rotate(-1deg) translateY(0);
        opacity: 1;
    }

    30% {
        transform: rotate(10deg) translateY(-30px) translateX(20px);
    }

    100% {
        transform: rotate(45deg) translateY(300px) translateX(150px);
        opacity: 0;
    }
}

@keyframes slideIn {
    0% {
        transform: rotate(-15deg) translateY(-100px) scale(0.8);
        opacity: 0;
    }

    100% {
        transform: rotate(-1deg) translateY(0) scale(1);
        opacity: 1;
    }
}

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

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

/* Post-It Header */
.postit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px dashed rgba(0, 0, 0, 0.15);
}

.note-number {
    font-size: 1.6rem;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

.tear-btn {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tear-btn:hover {
    background: rgba(255, 100, 100, 0.4);
    border-color: rgba(255, 100, 100, 0.5);
    transform: scale(1.1);
}

/* Task List */
.task-list {
    list-style: none;
    margin-bottom: 15px;
    flex-grow: 1;
    min-height: 150px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
    gap: 10px;
    animation: fadeIn 0.3s ease-out;
}

.task-checkbox {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.4);
    position: relative;
}

.task-checkbox:checked {
    background: linear-gradient(135deg, #4caf50, #45a049);
    border-color: #4caf50;
}

.task-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.task-checkbox:hover:not(:disabled) {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.6);
}

.task-checkbox:disabled {
    cursor: default;
}

.task-text {
    font-size: 1.3rem;
    color: rgba(0, 0, 0, 0.8);
    flex-grow: 1;
    word-break: break-word;
    transition: all 0.4s ease;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: rgba(0, 0, 0, 0.4);
    text-decoration-thickness: 2px;
    text-decoration-color: rgba(180, 50, 50, 0.7);
}

.task-item.completing .task-text {
    animation: strikethrough 0.4s ease-out forwards;
}

@keyframes strikethrough {
    0% {
        background: linear-gradient(to right, rgba(180, 50, 50, 0.7) 0%, transparent 0%);
        background-size: 100% 2px;
        background-position: 0 50%;
        background-repeat: no-repeat;
    }

    100% {
        background: linear-gradient(to right, rgba(180, 50, 50, 0.7) 100%, transparent 100%);
        background-size: 100% 2px;
        background-position: 0 50%;
        background-repeat: no-repeat;
    }
}

.delete-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s ease;
    padding: 5px;
}

.delete-btn:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* Add Task Form */
.add-task-form {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.task-input {
    flex-grow: 1;
    padding: 10px 12px;
    font-size: 1.1rem;
    font-family: 'Caveat', cursive;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(5px);
    outline: none;
    transition: all 0.3s ease;
    color: rgba(0, 0, 0, 0.8);
}

.task-input:focus {
    border-color: rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 3px rgba(255, 200, 100, 0.3);
}

.task-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.add-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.add-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: scale(1.1);
}

/* Messages */
.empty-message {
    text-align: center;
    color: rgba(0, 0, 0, 0.5);
    font-size: 1.2rem;
    padding: 30px 0;
}

.no-notes-message {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .login-card {
        padding: 40px 30px;
    }

    .login-card h1 {
        font-size: 2.8rem;
    }

    .app-header {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .header-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .app-header h1 {
        font-size: 1.5rem;
    }

    .postit {
        width: 100%;
        max-width: 350px;
        transform: rotate(0deg) !important;
    }

    .postit:hover {
        transform: scale(1.01) translateY(-3px) !important;
    }
}

@media (max-width: 400px) {
    .login-card h1 {
        font-size: 2.4rem;
    }

    .postit {
        padding: 15px;
        min-height: 300px;
    }

    .note-number {
        font-size: 1.4rem;
    }

    .task-text {
        font-size: 1.1rem;
    }
}

/* Touch-friendly */
@media (hover: none) and (pointer: coarse) {
    .task-checkbox {
        width: 28px;
        height: 28px;
    }

    .delete-btn {
        opacity: 0.6;
        padding: 8px;
    }

    .tear-btn {
        width: 44px;
        height: 44px;
    }

    .add-btn {
        width: 48px;
        height: 48px;
    }

    .logout-btn {
        width: 48px;
        height: 48px;
    }
}

/* ==================== MODAL STYLES ==================== */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: rgba(30, 40, 60, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 35px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content h2 {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 15px;
}

.modal-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 25px;
    line-height: 1.5;
}

.key-display {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 25px;
}

.key-display code {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #4ade80;
    word-break: break-all;
    text-align: left;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.key-input {
    width: 100%;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #4ade80;
    margin-bottom: 25px;
    outline: none;
    transition: all 0.3s ease;
}

.key-input:focus {
    border-color: rgba(74, 222, 128, 0.5);
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.2);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 12px 24px;
    font-size: 1.1rem;
    font-family: 'Caveat', cursive;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 222, 128, 0.3);
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 222, 128, 0.4);
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.key-btn {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.key-btn:hover {
    background: rgba(74, 222, 128, 0.4);
    transform: scale(1.1);
}