/* Global Styles */
:root {
    --neurols-purple: #8B5CF6;
    --neurols-blue: #60A5FA;
    --neurols-cyan: #22D3EE;
    --dark: #1a1a2e;
    --dark-card: rgba(31, 41, 55, 0.3);
    --border-color: rgba(107, 114, 128, 0.5);
}

body {
    background-color: var(--dark);
    color: #f3f4f6;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Card Styles */
.glass-card {
    background-color: rgba(31, 41, 55, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(107, 114, 128, 0.5);
    border-radius: 0.75rem;
}

.glass-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

/* Index Page Specific Styles */
.stat-card {
    background-color: rgba(31, 41, 55, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(107, 114, 128, 0.5);
    transition: all 0.3s ease;
}

.stat-card:hover {
    border-color: rgba(139, 92, 246, 0.5);
}

/* Calendar Styles */
.fc {
    height: 100%;
    background-color: rgba(31, 41, 55, 0.5);
    border-radius: 0.75rem;
    padding: 1rem;
}

.fc-theme-standard td, 
.fc-theme-standard th {
    border-color: rgba(107, 114, 128, 0.3);
}

.fc-theme-standard .fc-scrollgrid {
    border-color: rgba(107, 114, 128, 0.3);
}

.fc-day-today {
    background-color: rgba(139, 92, 246, 0.1) !important;
}

.fc-button-primary {
    background-color: var(--neurols-purple) !important;
    border-color: #7C3AED !important;
}

.fc-button-primary:hover {
    background-color: #7C3AED !important;
}

.fc-event {
    cursor: pointer;
    transition: transform 0.2s;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    opacity: 0.9;
}

.fc-event:hover {
    transform: scale(1.02);
    opacity: 1;
}

.fc-daygrid-event {
    border-radius: 0.5rem;
    border-width: 0;
    display: block !important;
    margin: 2px 0 !important;
}

.fc-daygrid-dot-event {
    background-color: inherit !important;
    color: white !important;
}

.fc-daygrid-dot-event .fc-event-title {
    color: white !important;
    font-weight: 500;
}

.fc-event-past {
    opacity: 0.75;
}

.fc-event-today {
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.fc-event-future {
    opacity: 0.9;
}

.fc-event-time {
    font-weight: 600;
    color: white !important;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.fc-popover {
    background-color: rgba(31, 41, 55, 0.95);
    border-radius: 0.5rem;
    border: 1px solid rgba(107, 114, 128, 0.3);
    backdrop-filter: blur(10px);
}

.fc-popover-header {
    background-color: rgba(31, 41, 55, 0.8);
    color: #f3f4f6;
}

.fc-col-header-cell-cushion,
.fc-daygrid-day-number {
    color: #d1d5db;
    text-decoration: none !important;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: rgba(31, 41, 55, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 1px solid rgba(107, 114, 128, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(107, 114, 128, 0.3);
}

.modal-header h3 {
    margin: 0;
    color: #f3f4f6;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #f3f4f6;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #d1d5db;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
    color: #f3f4f6;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--neurols-purple);
}

.form-group input[readonly] {
    background-color: rgba(31, 41, 55, 0.3);
    color: #9ca3af;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
}

.btn-save {
    padding: 0.75rem 1.5rem;
    background-color: var(--neurols-purple);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-save:hover {
    background-color: #7C3AED;
}

.btn-delete {
    padding: 0.75rem 1.5rem;
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete:hover {
    background-color: rgba(239, 68, 68, 0.3);
    border-color: rgba(239, 68, 68, 0.5);
}

.btn-delete.hidden {
    display: none;
}

/* Mobile styles */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
    }
    
    .fc-header-toolbar {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .fc-dayGridMonth-button,
    .fc-timeGridWeek-button,
    .fc-timeGridDay-button {
        padding: 0.4rem !important;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-save,
    .btn-delete {
        width: 100%;
    }
}

/* Dragging Effects */
.dragging {
    opacity: 0.5;
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(to right, var(--neurols-purple), var(--neurols-blue), var(--neurols-cyan));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.gradient-text-purple {
    background: linear-gradient(to right, #9333EA, #A855F7, #D8B4FE);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Transitions */
.transition-all {
    transition: all 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.3);
}

::-webkit-scrollbar-thumb {
    background: var(--neurols-purple);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #7C3AED;
}

/* Email Server Link */
.email-link {
    margin-bottom: 1rem;
    display: flex;
    justify-content: flex-end;
}

.mail-server-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 0.5rem;
    transition: all 0.2s;
    color: #f3f4f6;
    text-decoration: none;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.mail-server-link:hover {
    background: rgba(31, 41, 55, 0.7);
    border-color: var(--neurols-purple);
}

.icon-mail {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--neurols-purple);
}

/* Vault Styles */
.vault-card {
    background-color: rgba(31, 41, 55, 0.4);
    border-color: rgba(147, 51, 234, 0.5);
}

.vault-card:hover {
    border-color: rgba(147, 51, 234, 0.7);
}

.vault-search-input {
    padding: 0.75rem 1rem;
    padding-right: 2.5rem;
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
    color: #f3f4f6;
    transition: all 0.2s;
}

.vault-search-input:focus {
    outline: none;
    border-color: #9333EA;
}

.icon-search {
    width: 1.25rem;
    height: 1.25rem;
    color: #9CA3AF;
}

.vault-add-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #9333EA;
    color: white;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.vault-add-btn:hover {
    background: #7E22CE;
}

.vault-entries-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.vault-entry {
    background: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.vault-entry:hover {
    border-color: #9333EA;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.vault-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.vault-entry-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #f3f4f6;
    margin-right: 0.5rem;
}

.vault-entry-date {
    font-size: 0.8rem;
    color: #9CA3AF;
    margin-top: 0.25rem;
}

.vault-entry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.vault-tag {
    background: rgba(147, 51, 234, 0.2);
    color: #D8B4FE;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
}

.vault-entry-actions {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.75rem;
}

.vault-view-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(147, 51, 234, 0.2);
    color: #D8B4FE;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.vault-view-btn:hover {
    background: rgba(147, 51, 234, 0.3);
}

.vault-has-file {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #9CA3AF;
    font-size: 0.8rem;
}

.vault-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 3rem 1rem;
    color: #9CA3AF;
}

.icon-vault-empty {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    color: #4B5563;
}

.vault-decrypted-content {
    color: #D1D5DB;
    font-family: monospace;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
}

/* Mobile Styles for Vault */
@media (max-width: 640px) {
    .vault-entries-container {
        grid-template-columns: 1fr;
    }
    
    .vault-search-input {
        width: 100%;
    }
    
    .vault-add-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Textarea Styles */
textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
    color: #f3f4f6;
    font-size: 0.95rem;
    transition: border-color 0.2s;
    font-family: monospace;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: var(--neurols-purple);
}

/* File Input Styles */
input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
    color: #f3f4f6;
}

.file-info {
    color: #9CA3AF;
}

/* Password verification */
#vault-password-error {
    color: #EF4444;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

#vault-password {
    padding: 0.75rem;
    background-color: rgba(31, 41, 55, 0.5);
    border: 1px solid rgba(107, 114, 128, 0.3);
    border-radius: 0.5rem;
    color: #f3f4f6;
}

#vault-verify-btn {
    padding: 0.75rem 1.25rem;
    min-width: 100px;
}

/* Animated Text Gradient */
.animated-gradient-text {
    background-image: linear-gradient(
        90deg,
        var(--neurols-purple) 0%,
        var(--neurols-blue) 50%,
        var(--neurols-cyan) 100%
    );
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    opacity: 0.7;
}

/* Line-by-line animation delays */
.line-1 { animation: gradientFlow 8s ease infinite; animation-delay: 0s; }
.line-2 { animation: gradientFlow 8s ease infinite; animation-delay: 0.8s; }
.line-3 { animation: gradientFlow 8s ease infinite; animation-delay: 1.6s; }

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
        opacity: 0.7;
    }
    50% {
        background-position: 100% 50%;
        opacity: 1;
    }
    100% {
        background-position: 0% 50%;
        opacity: 0.7;
    }
}

/* Task List Styles */
.task-list-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

.task-input-group {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.task-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: #f3f4f6;
}

.task-date-input {
    width: 160px;
    padding: 0.75rem;
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    color: #f3f4f6;
}

.task-add-btn {
    padding: 0.75rem 1.5rem;
    background: var(--neurols-purple);
    color: white;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.task-add-btn:hover {
    background: #7C3AED;
}

/* Task Item Styles - Desktop */
.task-item {
    display: grid;
    grid-template-columns: 60px 1fr 200px;
    align-items: center;
    padding: 1rem;
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: all 0.2s;
}

/* Left icons column */
.task-icons {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    gap: 0.5rem;
}

.task-drag-handle {
    cursor: grab;
    color: #a3a3a3;
    font-size: 1.75rem;
    padding: 0.5rem;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.task-drag-handle:hover {
    color: #d1d5db;
}

.task-drag-handle:active {
    cursor: grabbing;
    color: var(--neurols-purple);
}

.task-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ef4444;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.task-pin:hover {
    background: rgba(239, 68, 68, 0.1);
}

.task-pin.pinned {
    color: #ef4444;
}

.task-checkbox-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.task-checkbox {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 0.375rem;
    border: 2px solid #4b5563;
    background: #22223a;
    cursor: pointer;
}

/* Middle content column */
.task-main {
    padding: 0 1rem;
}

.task-title {
    font-size: 1rem;
    line-height: 1.5;
}

/* Right actions column */
.task-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.task-date-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-date {
    padding: 0.5rem;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.task-delete {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #ef4444;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.task-delete:hover {
    background: rgba(239, 68, 68, 0.1);
}

.delete-text {
    font-size: 0.875rem;
}

/* Done state */
.task-done {
    background: #14532d !important;
    border-color: #166534;
}

.task-done .task-title {
    color: #bbf7d0;
    text-decoration: line-through;
}

/* Mobile Layout */
@media (max-width: 640px) {
    /* Task item structure */
    .task-item {
        grid-template-columns: 60px 1fr;
        grid-template-rows: auto auto;
    }
    
    /* Left column with icons */
    .task-icons {
        grid-column: 1;
        grid-row: 1 / span 2;
    }
    
    /* Main content (task title) */
    .task-main {
        grid-column: 2;
        grid-row: 1;
        padding: 0.5rem 0;
    }
    
    /* Actions row (date and delete) */
    .task-actions {
        grid-column: 2;
        grid-row: 2;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .task-drag-handle {
        font-size: 2rem;
    }
    
    .task-checkbox {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .task-title {
        font-size: 1rem;
        overflow-wrap: break-word;
        word-break: break-word;
    }
    
    .delete-text {
        display: none;
    }
    
    .task-input-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .task-date-input {
        width: 100%;
    }
    
    .task-add-btn {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Sortable Styles */
.sortable-ghost {
    background: rgba(139, 92, 246, 0.1) !important;
    border: 2px dashed var(--neurols-purple) !important;
    opacity: 0.5;
}

.sortable-chosen {
    background: rgba(139, 92, 246, 0.05);
    border-color: var(--neurols-purple);
}

.sortable-drag {
    opacity: 1;
    background: var(--dark-card);
    transform: scale(1.02);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

/* Icon Styles */
.icon {
    width: 1.25rem;
    height: 1.25rem;
    stroke-width: 2;
}

.icon-pin {
    color: #fbbf24;
}

.icon-calendar {
    color: var(--neurols-purple);
}

.icon-logout {
    display: none;
    color: white;
}

/* Responsive Logout Button */
.logout-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--neurols-purple);
    color: white;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.logout-btn:hover {
    background: #7C3AED;
}

@media (max-width: 640px) {
    .logout-btn {
        padding: 0.75rem;
        border-radius: 0.375rem;
    }

    .logout-text {
        display: none;
    }

    .icon-logout {
        display: block;
    }
}

/* Kontrolle Calendar Styles */
.kontrolle-card {
    background-color: rgba(25, 35, 55, 0.4);
    border-color: rgba(59, 130, 246, 0.5);
}

.kontrolle-card:hover {
    border-color: rgba(59, 130, 246, 0.7);
}

.gradient-text-blue {
    background: linear-gradient(to right, #3B82F6, #60A5FA, #93C5FD);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

#kontrolle-calendar.fc {
    background-color: rgba(25, 35, 55, 0.6);
}

#kontrolle-calendar .fc-button-primary {
    background-color: #3B82F6 !important;
    border-color: #2563EB !important;
}

#kontrolle-calendar .fc-button-primary:hover {
    background-color: #2563EB !important;
}

#kontrolle-calendar .fc-day-today {
    background-color: rgba(59, 130, 246, 0.1) !important;
}

#kontrolle-modal .btn-save {
    background-color: #3B82F6;
}

#kontrolle-modal .btn-save:hover {
    background-color: #2563EB;
}

/* Mobile styles for Kontrolle Calendar */
@media (max-width: 640px) {
    /* Ensure calendars don't overlap on small screens */
    .kontrolle-card {
        margin-top: 2rem;
    }
    
    /* Adjust calendar height on mobile */
    #kontrolle-calendar {
        min-height: 500px !important;
    }
}

/* Workaround for multiple calendars - prevent z-index conflicts */
.fc-popover {
    z-index: 100 !important;
}

#kontrolle-calendar .fc-view-harness {
    z-index: 0 !important;
}

#calendar .fc-view-harness {
    z-index: 0 !important;
}

/* Make sure modals appear above both calendars */
.modal {
    z-index: 1000 !important;
} 