/* Trifle App Styles - Light Theme */

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

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

.header {
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(225, 228, 232, 0.5);
    padding: 16px 24px;
}

.header h1 {
    color: #667eea;
    font-size: 24px;
    font-weight: 600;
}

.header h1 .logo-link {
    color: #667eea;
    text-decoration: none;
}

.header h1 .logo-link:visited {
    color: #667eea;
}

.header h1 .logo-link:hover {
    color: #667eea;
}

.header h1 .logo-link:active {
    color: #667eea;
}

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

/* Profile Card */
.profile-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(225, 228, 232, 0.5);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-card-link {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.profile-card-link:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: #667eea;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4ff;
    border-radius: 8px;
    overflow: hidden;
}

.profile-avatar svg {
    width: 100%;
    height: 100%;
}

.profile-name {
    font-size: 18px;
    font-weight: 600;
    color: #1a1f36;
    margin-bottom: 4px;
}

.profile-hint {
    font-size: 12px;
    color: #999;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title {
    font-size: 32px;
    font-weight: 600;
    color: #1a1f36;
}

.new-trifle-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.new-trifle-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.trifles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.trifle-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(225, 228, 232, 0.5);
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.trifle-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.trifle-card.editing {
    cursor: default;
    pointer-events: none;
}

.trifle-card.editing .description-input {
    pointer-events: auto;
}

.trifle-card.editing:hover {
    border-color: #e1e4e8;
    box-shadow: none;
    transform: none;
}

.trifle-card-content {
    pointer-events: none;
}

.delete-trifle-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: auto;
}

.trifle-card:hover .delete-trifle-btn {
    opacity: 1;
}

.delete-trifle-btn:hover {
    background: #c0392b;
}

.trifle-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1f36;
    margin-bottom: 8px;
}

.trifle-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.trifle-description-text {
    flex: 1;
}

.edit-description-btn {
    background: transparent;
    color: #999;
    border: none;
    padding: 0;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    pointer-events: auto;
    flex-shrink: 0;
}

.trifle-card:hover .edit-description-btn {
    opacity: 1;
}

.edit-description-btn:hover {
    color: #667eea;
}

.description-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #667eea;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.trifle-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-state h2 {
    color: #666;
    font-size: 24px;
    margin-bottom: 12px;
}

.empty-state p {
    color: #999;
    font-size: 16px;
    margin-bottom: 24px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.error {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 24px;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.90);
    border-radius: 8px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
}

.modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #f0f4ff;
    color: #667eea;
    border: 1px solid #667eea;
}

.btn-secondary:hover {
    background: #e0e9ff;
}

.btn-cancel {
    background: #f6f8fa;
    color: #333;
    border: 1px solid #d1d5da;
}

.btn-cancel:hover {
    background: #e9ecef;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.notification {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 320px;
    max-width: 600px;
    padding: 14px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.5;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification-visible {
    opacity: 1;
    transform: translateY(0);
}

.notification-dismissed {
    opacity: 0;
    transform: translateY(-20px);
}

.notification-error {
    background: #fee;
    color: #c00;
    border: 1px solid #fcc;
}

.notification-success {
    background: #efe;
    color: #060;
    border: 1px solid #cfc;
}

.notification-info {
    background: #eef;
    color: #006;
    border: 1px solid #ccf;
}

.notification-message {
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: opacity 0.2s ease, background 0.2s ease;
}

.notification-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
}

.notification-close:active {
    background: rgba(0, 0, 0, 0.2);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(225, 228, 232, 0.5);
    padding: 8px 24px;
    font-size: 12px;
    color: #666;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.sync-status {
    cursor: default;
}

.sync-status.synced {
    color: #27ae60;
}

.sync-status.not-synced {
    color: #999;
}

.sync-status.offline {
    color: #e74c3c;
}

.footer-sync-btn {
    background: transparent;
    color: #667eea;
    border: 1px solid #667eea;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.footer-sync-btn:hover {
    background: #667eea;
    color: white;
}

.footer-sync-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
