* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.dashboard {
    width: 90%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 90vh;
    position: relative;
}

.header {
    padding: 25px 30px;
    background: rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header h1 i {
    color: #ffd166;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.privacy-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.privacy-text {
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.privacy-icon {
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1000;
}

.privacy-icon:hover {
    transform: scale(1.2);
    color: #22c55e;
}

.privacy-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 15px;
    border-radius: 12px;
    font-size: 0.8rem;
    width: 300px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    line-height: 1.5;
}

.privacy-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 10px;
    border: 6px solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.95);
}

.privacy-icon:hover .privacy-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Import/Export buttons */
.import-export {
    display: flex;
    gap: 10px;
}

.import-btn, .export-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.import-btn:hover, .export-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.import-btn:hover {
    color: #4ade80;
}

.export-btn:hover {
    color: #3b82f6;
}

/* Blinking effect */
@keyframes secureBlink {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
    }
    50% {
        opacity: 0.7;
        text-shadow: 0 0 20px rgba(74, 222, 128, 0.8);
    }
}

.secure-badge {
    animation: secureBlink 2s ease-in-out infinite;
    color: #fff;
    font-weight: 600;
}

.notes-container {
    flex: 1;
    padding: 25px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    align-content: flex-start;
    overflow-y: auto;
    position: relative;
    z-index: 1;
}

.note-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.note-type {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
}

.note-type.text {
    background: linear-gradient(135deg, #42e695 0%, #3bb2b8 100%);
}

.note-type.password {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.note-type.video {
    background: linear-gradient(135deg, #a166ab 0%, #c779d0 100%);
}

.note-type.url {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.note-type.code {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.note-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.note-preview {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.4;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.note-date {
    font-size: 0.75rem;
    color: #888;
    text-align: right;
    margin-top: 8px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.new-note-btn {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.5);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 100;
}

.new-note-btn:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.6);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transform: translateY(30px);
    transition: transform 0.4s;
    z-index: 1001;
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 25px 30px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.modal-header h2 {
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.2);
}

.password-field, .code-field {
    position: relative;
}

.toggle-password, .toggle-code {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 1.1rem;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 158, 11, 0.4);
}

.detail-modal {
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    z-index: 1002;
}

.detail-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.note-detail {
    margin-bottom: 20px;
}

.detail-label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

.detail-value {
    background: #f9f9f9;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    word-break: break-all;
}

.detail-value.scrollable {
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.5;
    position: relative;
    padding: 0;
}

.password-detail-field {
    position: relative;
}

.detail-value.password {
    font-family: monospace;
    letter-spacing: 2px;
    padding-right: 50px;
}

.detail-toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    font-size: 1.1rem;
}

.clickable-link {
    color: #2575fc;
    text-decoration: none;
    word-break: break-all;
}

.clickable-link:hover {
    text-decoration: underline;
}

.code-block {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    position: relative;
}

.text-content-area {
    width: 100%;
    height: 250px;
    border: none;
    background: transparent;
    resize: none;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.5;
    padding: 15px;
    color: #333;
}

.text-content-area:focus {
    outline: none;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 10;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: #f1f3f4;
    color: #333;
}

.text-copy-btn {
    top: 10px;
    right: 10px;
}

.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    flex: 1;
}

.btn-danger {
    background: #dc3545;
    color: white;
    flex: 1;
}

.detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.detail-meta-left {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex: 1;
}

.detail-meta-right {
    display: flex;
    align-items: center;
}

#shareNoteBtn {
    padding: 12px 20px;
    font-size: 1rem;
    white-space: nowrap;
    min-width: 100px;
}

.detail-meta > div {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.detail-type {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 15px;
    color: white;
    font-weight: 600;
}

.detail-date {
    font-size: 0.85rem;
    color: #666;
    text-align: left;
}

/* Share link styles */
.share-link-container {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    position: relative;
}

.share-link {
    word-break: break-all;
    padding: 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 0.9rem;
}

.share-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.share-info {
    font-size: 0.8rem;
    color: #666;
    margin-top: 5px;
    text-align: center;
}

.expired-badge {
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.active-badge {
    background: #10b981;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
}

.cloud-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #856404;
}

.cloud-warning i {
    color: #f59e0b;
    margin-right: 8px;
}

/* Security warning modal */
.security-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    color: white;
    text-align: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.warning-content {
    background: rgba(255, 0, 0, 0.2);
    border: 2px solid rgba(255, 0, 0, 0.5);
    border-radius: 15px;
    padding: 30px;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
}

.warning-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #ff6b6b;
}

.warning-content p {
    margin-bottom: 20px;
    line-height: 1.6;
}

.warning-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #ff6b6b;
}

/* Loading spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #6a11cb;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* PWA Install Button */
#installButton {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.4);
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
        min-height: 100vh;
    }
    
    .dashboard {
        width: 100%;
        height: calc(100vh - 20px);
        border-radius: 15px;
    }
    
    .header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .privacy-notice {
        width: 100%;
        justify-content: center;
        padding: 10px;
    }
    
    .privacy-text {
        font-size: 0.8rem;
    }
    
    .privacy-tooltip {
        width: 90vw;
        max-width: 300px;
        right: 50%;
        transform: translateX(50%) translateY(-10px);
        font-size: 0.75rem;
        padding: 12px;
    }
    
    .privacy-tooltip::before {
        right: 50%;
        transform: translateX(50%);
    }
    
    .import-export {
        width: 100%;
        justify-content: center;
    }
    
    .notes-container {
        padding: 15px;
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .note-card {
        height: 120px;
        padding: 15px;
    }
    
    .note-title {
        font-size: 1rem;
    }
    
    .note-preview {
        font-size: 0.8rem;
    }
    
    .new-note-btn {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        bottom: 20px;
    }
    
    .modal {
        width: 95%;
        max-width: 95%;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-control {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .detail-modal {
        max-width: 95%;
        max-height: 95vh;
    }
    
    .detail-modal .modal-body {
        padding: 20px;
    }
    
    .detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .detail-actions {
        flex-direction: column;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .code-block {
        padding: 10px;
        font-size: 0.8rem;
    }
    
    .text-content-area {
        height: 200px;
        padding: 10px;
    }
    
    .empty-state {
        padding: 30px 15px;
    }
    
    .empty-state i {
        font-size: 3rem;
    }
    
    .empty-state h3 {
        font-size: 1.3rem;
    }
    
    .share-actions {
        flex-direction: column;
    }
    
    .warning-content {
        padding: 20px;
        margin: 15px;
    }
    
    .warning-content h2 {
        font-size: 1.5rem;
    }
    
    .warning-icon {
        font-size: 3rem;
    }

    #installButton {
        bottom: 90px;
        right: 15px;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .privacy-text {
        font-size: 0.75rem;
    }
    
    .note-card {
        height: 110px;
        padding: 12px;
    }
    
    .note-title {
        font-size: 0.9rem;
    }
    
    .note-type {
        font-size: 0.65rem;
        padding: 3px 8px;
    }
    
    .new-note-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.2rem;
    }
    
    .modal-body {
        padding: 15px;
    }
}

/* Handle landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .dashboard {
        height: 95vh;
    }
    
    .header {
        padding: 10px 15px;
    }
    
    .notes-container {
        padding: 10px;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .note-card {
        height: 100px;
        padding: 10px;
    }
    
    .new-note-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        bottom: 15px;
    }
}

/* Mobile responsive for the new layout */
@media (max-width: 768px) {
    .detail-meta {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 20px;
        padding-bottom: 12px;
    }
    
    .detail-meta-left {
        justify-content: flex-start;
        gap: 0px 10px 10px 10px;
    }
    
    .detail-meta-right {
        justify-content: flex-end;
    }
    
    #shareNoteBtn {
        padding: 10px 20px;
        font-size: 0.9rem;
        width: auto;
    }
}

@media (max-width: 480px) {
    .detail-meta > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #shareNoteBtn {
        align-self: flex-start;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .note-card:hover {
        transform: none;
    }
    
    .new-note-btn:hover {
        transform: translateX(-50%);
    }
    
    .import-btn:hover, .export-btn:hover {
        transform: none;
    }
    
    .btn-primary:hover {
        transform: none;
    }
    
    .copy-btn:hover {
        background: rgba(255, 255, 255, 0.9);
        color: #666;
    }
}