/* CSS Variables for Themes */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #e74c3c;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-background: rgba(255, 255, 255, 0.95);
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #ecf0f1;
    --success-color: #27ae60;
    --warning-color: #f39c12;
}

[data-theme="warm"] {
    --primary-color: #e67e22;
    --secondary-color: #d35400;
    --background-gradient: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

[data-theme="nature"] {
    --primary-color: #27ae60;
    --secondary-color: #229954;
    --background-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

[data-theme="elegant"] {
    --primary-color: #8e44ad;
    --secondary-color: #7d3c98;
    --background-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="dark"] {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-gradient: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    --card-background: rgba(52, 73, 94, 0.9);
    --text-primary: #ecf0f1;
    --text-secondary: #bdc3c7;
    --border-color: #34495e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--background-gradient);
    min-height: 100vh;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

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

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

.breadcrumb a:hover {
    opacity: 1;
}

/* Main Quote Display */
.quote-display {
    margin-bottom: 3rem;
}

.quote-card {
    background: var(--card-background);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    transition: all 0.3s ease;
}

.quote-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.principle-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

.principle-icon {
    font-size: 1.1rem;
}

.quote-content {
    margin-bottom: 2rem;
}

.quote-text {
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-style: italic;
    position: relative;
}

.quote-text::before {
    content: '"';
    font-size: 3rem;
    position: absolute;
    left: -2rem;
    top: -1rem;
    opacity: 0.3;
    color: var(--primary-color);
}

.quote-text::after {
    content: '"';
    font-size: 3rem;
    position: absolute;
    right: -2rem;
    bottom: -2rem;
    opacity: 0.3;
    color: var(--primary-color);
}

.quote-author {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.quote-context {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.quote-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.action-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.action-btn.favorited {
    background: var(--accent-color);
}

.action-btn.favorited i {
    color: white;
}

/* Widget Controls */
.widget-controls {
    margin-bottom: 3rem;
}

.control-card {
    background: var(--card-background);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.control-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group label {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 150px;
}

.control-group select,
.control-group input[type="range"] {
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    background: white;
    color: var(--text-primary);
}

.control-group select {
    min-width: 200px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.switch:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .switch {
    background-color: var(--primary-color);
}

input:checked + .switch:before {
    transform: translateX(26px);
}

.control-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Quote History */
.quote-history {
    margin-bottom: 3rem;
}

.history-card {
    background: var(--card-background);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.history-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.history-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.3s ease;
}

.history-item:hover {
    background: rgba(0,0,0,0.05);
}

.history-item:last-child {
    border-bottom: none;
}

.history-quote {
    font-style: italic;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.history-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

.clear-history-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.clear-history-btn:hover {
    background: #c0392b;
}

/* Favorites */
.favorites {
    margin-bottom: 3rem;
}

.favorites-card {
    background: var(--card-background);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.favorites-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.no-favorites {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-favorites i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.favorite-item {
    background: rgba(255,255,255,0.7);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.favorite-quote {
    font-style: italic;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.favorite-author {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

.remove-favorite {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Embed Widget */
.embed-widget {
    margin-bottom: 3rem;
}

.embed-card {
    background: var(--card-background);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.embed-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.embed-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

#embedCode {
    width: 100%;
    height: 120px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #f8f9fa;
    color: var(--text-primary);
    resize: vertical;
    margin-bottom: 1rem;
}

.copy-embed-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-embed-btn:hover {
    background: var(--secondary-color);
}

/* Statistics */
.quote-stats {
    margin-bottom: 3rem;
}

.stats-card {
    background: var(--card-background);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.stats-card h3 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    justify-content: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255,255,255,0.7);
    border-radius: 10px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--card-background);
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-body {
    padding: 1.5rem;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
}

.share-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.share-text label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

#shareTextArea {
    width: 100%;
    height: 80px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
}

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

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-icon {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .quote-card {
        padding: 2rem;
    }
    
    .quote-text {
        font-size: 1.4rem;
    }
    
    .quote-text::before,
    .quote-text::after {
        display: none;
    }
    
    .quote-actions {
        flex-direction: column;
    }
    
    .control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group label {
        min-width: auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-options {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.quote-card {
    animation: fadeIn 0.5s ease;
}

.action-btn:active {
    animation: pulse 0.3s ease;
}

.stat-number {
    animation: fadeIn 1s ease;
}

/* Font Size Adjustment */
.quote-text {
    font-size: var(--quote-font-size, 1.8rem);
}