/**
 * Property Notes (Sticky Notes) Styles
 * Yellow post-it notes and folded corner indicators
 */

/* ===========================
   Add Note Button (Top-right Action Bar)
   =========================== */

.btn-add-note {
    position: absolute;
    top: 12px;
    right: 100px; /* Left of compare button */
    z-index: 15;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #5d4037;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Show on hover */
.property-card:hover .btn-add-note {
    opacity: 1;
}

[data-theme="dark"] .btn-add-note {
    background: rgba(44, 62, 80, 0.95);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffd54f;
}

.btn-add-note:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .btn-add-note:hover {
    background: #5a4a2a;
}

.btn-add-note i {
    font-size: 1.1rem;
}

/* ===========================
   Note Indicators
   =========================== */

/* Post-it style (favorites page) - Top-right action bar when note exists */
.note-indicator.post-it {
    position: absolute;
    top: 12px;
    right: 100px; /* Left of compare button, same as btn-add-note */
    z-index: 15;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #ffd54f 0%, #ffca28 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    color: #f57c00;
}

.note-indicator.post-it:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.note-indicator.post-it i {
    font-size: 1.1rem;
}

/* Folded corner (rentals page) */
.note-indicator.folded-corner {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 15;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 36px 36px;
    border-color: transparent transparent #ffd54f transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    filter: drop-shadow(-2px -2px 4px rgba(0, 0, 0, 0.2));
}

/* Bounce animation on card hover */
.property-card:hover .note-indicator.folded-corner {
    animation: cornerBounce 0.6s ease-out;
}

.note-indicator.folded-corner:hover {
    border-width: 0 0 44px 44px;
    filter: drop-shadow(-3px -3px 6px rgba(0, 0, 0, 0.3));
}

/* Dark mode for folded corner */
[data-theme="dark"] .note-indicator.folded-corner {
    border-color: transparent transparent #ffca28 transparent;
}

/* ===========================
   Animations
   =========================== */

@keyframes cornerBounce {
    0% {
        border-width: 0 0 36px 36px;
    }
    30% {
        border-width: 0 0 48px 48px;
    }
    50% {
        border-width: 0 0 42px 42px;
    }
    70% {
        border-width: 0 0 46px 46px;
    }
    100% {
        border-width: 0 0 36px 36px;
    }
}

/* ===========================
   Note Modal (Editor)
   =========================== */

.note-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.note-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.note-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: #fff8dc; /* Light yellow paper color */
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    /* Paper texture */
    background-image: 
        linear-gradient(to bottom, transparent 1px, transparent 1px),
        linear-gradient(90deg, #f5f5dc 0%, #fff8dc 100%);
}

[data-theme="dark"] .note-modal-content {
    background: #5b4d3f; /* More earthy brown */
    background-image: 
        linear-gradient(to bottom, transparent 1px, transparent 1px), 
        linear-gradient(90deg, #605449 0%, #5b4d3f 100%);
}

.note-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.note-modal-header h3 {
    margin: 0;
    color: #5d4037;
    font-size: 1.5rem;
}

[data-theme="dark"] .note-modal-header h3 {
    color: #ffffff; /* White for better contrast */
}

.note-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #5d4037;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

[data-theme="dark"] .note-modal-close {
    color: #d4d4d4; /* Light grey close button */
}

.note-modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: rotate(90deg);
}

.note-modal-body {
    padding: 1.5rem;
}

.note-helper-text {
    margin: 0 0 1rem 0;
    color: #8d6e63;
    font-size: 0.95rem;
    line-height: 1.5;
}

[data-theme="dark"] .note-helper-text {
    color: #e0e0e0; /* Light grey for helper text */
}

.note-textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid #daa520;
    border-radius: 6px;
    background: #fffaf0;
    color: #3e2723;
    font-size: 1rem;
    font-family: 'Segoe UI', system-ui, sans-serif;
    resize: vertical;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .note-textarea {
    background: #3d342b; /* Earthy dark brown */
    color: #ffffff; /* White text */
    border-color: #8b7355; /* Softer brown border */
}

.note-textarea:focus {
    outline: none;
    border-color: #ffc107;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

.note-char-count {
    text-align: right;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #8d6e63;
}

[data-theme="dark"] .note-char-count {
    color: #b0b0b0; /* Light grey for character count */
}

.note-char-current {
    font-weight: 600;
}

.note-modal-footer {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-note-delete {
    background: transparent;
    color: #d32f2f;
    border: 2px solid #d32f2f;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-note-delete:hover {
    background: #d32f2f;
    color: white;
}

.btn-note-save {
    background: linear-gradient(135deg, #ffc107 0%, #ffa000 100%);
    color: #3e2723;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.btn-note-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

/* ===========================
   Card Flip Effect (Rentals)
   =========================== */

.property-card {
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.property-card.flipped-to-note {
    pointer-events: none;
}

.property-note-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #fff8dc 0%, #ffd54f 100%);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 20;
    display: flex;
    flex-direction: column;
    pointer-events: all;
    animation: flipIn 0.4s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .property-note-overlay {
    background: linear-gradient(135deg, #4a3f35 0%, #5a4f45 100%); /* Earthy gradient */
}

.note-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.note-overlay-header h4 {
    margin: 0;
    color: #5d4037;
    font-size: 1.25rem;
}

[data-theme="dark"] .note-overlay-header h4 {
    color: #ffffff; /* White text */
}

.note-overlay-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.1);
    color: #5d4037;
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s ease;
}

[data-theme="dark"] .note-overlay-close {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e0e0; /* Light grey */
}

.note-overlay-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.note-overlay-content {
    flex: 1;
    color: #3e2723;
    font-size: 1rem;
    line-height: 1.6;
    overflow-y: auto;
    padding: 0.5rem 0;
}

[data-theme="dark"] .note-overlay-content {
    color: #ffffff; /* White text for readability */
}

.note-overlay-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.btn-note-edit-small {
    background: linear-gradient(135deg, #ffc107 0%, #ffa000 100%);
    color: #3e2723;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-note-edit-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

/* ===========================
   Toast Notifications
   =========================== */

.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: bottom 0.3s ease;
    z-index: 10001;
    font-size: 1rem;
}

.toast.show {
    bottom: 2rem;
}

.toast.toast-success {
    background: #4caf50;
}

.toast.toast-error {
    background: #f44336;
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes flipIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================
   Responsive
   =========================== */

@media (max-width: 768px) {
    .note-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .note-textarea {
        min-height: 120px;
    }
    
    .note-modal-footer {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .btn-note-delete,
    .btn-note-save {
        width: 100%;
    }
    
    .property-note-overlay {
        padding: 1rem;
    }
}

