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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

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

/* Main content */
main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

/* Editor container */
.editor-container {
    padding: 30px;
}

/* Language selector */
.language-selector {
    margin-bottom: 20px;
}

.language-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.language-selector select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
}

.language-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* Expiration selector */
.expiration-selector {
    margin-bottom: 20px;
}

.expiration-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.expiration-selector select {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    transition: border-color 0.3s ease;
}

.expiration-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* Editor wrapper */
.editor-wrapper {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* CodeMirror customization */
.CodeMirror {
    font-family: 'Fira Code', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Actions */
.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #6c757d;
    border: 2px solid #e9ecef;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
    color: white;
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(23, 162, 184, 0.4);
}

/* Result container */
.result-container {
    background: #f8f9fa;
    padding: 30px;
    border-top: 1px solid #e9ecef;
}

.result-container h3 {
    margin-bottom: 20px;
    color: #28a745;
    font-size: 1.5rem;
}

.link-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.link-container input {
    flex: 1;
    min-width: 300px;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    background: white;
}

.warning-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.warning-message p {
    color: #856404;
    margin: 0;
    font-weight: 500;
}

/* Share options */
.share-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-option {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    background: white;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.share-option:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-2px);
}

/* Note container styles */
.note-container {
    padding: 30px;
}

.note-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.language-badge, .date-badge, .expiration-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.language-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.date-badge {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.expiration-badge {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
    animation: pulse 2s infinite;
}

.expiration-badge.normal {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.expiration-badge.warning {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    animation: pulse 1.5s infinite;
}

.expiration-badge.urgent {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
    animation: pulse 1s infinite;
}

.expiration-badge.expired {
    background: rgba(108, 117, 125, 0.2);
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.3);
    animation: none;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Confirm container */
.confirm-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.confirm-box {
    background: white;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    max-width: 500px;
    width: 100%;
}

.confirm-box h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.confirm-box p {
    color: #ffc107;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.confirm-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Error container */
.error-container {
    text-align: center;
    padding: 40px;
}

.error-container h3 {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.error-container p {
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .editor-container {
        padding: 20px;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .link-container {
        flex-direction: column;
    }

    .link-container input {
        min-width: auto;
    }

    .share-options {
        justify-content: center;
    }

    .note-info {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Notification styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.notification.error {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.notification.info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dark theme support */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    }

    main {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .language-selector select,
    .expiration-selector select,
    .link-container input {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7a;
    }

    .language-selector label,
    .expiration-selector label {
        color: #ecf0f1;
    }

    .result-container {
        background: #34495e;
        border-top-color: #4a5f7a;
    }

    .warning-message {
        background: #3d4852;
        border-color: #4a5f7a;
    }

    .warning-message p {
        color: #f6ad55;
    }

    .share-option {
        background: #34495e;
        color: #ecf0f1;
        border-color: #4a5f7a;
    }

    .share-option:hover {
        border-color: #667eea;
        color: #667eea;
    }

    .confirm-box {
        background: #34495e;
        color: #ecf0f1;
    }

    .confirm-box h3 {
        color: #667eea;
    }

    .confirm-box p {
        color: #f6ad55;
    }
}
