/* Enhanced Dashboard Styles for HomilyWriterAI */

:root {
    --primary-light: #d2c4e4;
    --primary: #a4b6e5;
    --primary-medium: #6490d3;
    --primary-dark: #4e81bc;
    --primary-darker: #2a6b9d;
    --white: #ffffff;
    --light-gray: #f8f9fa;
    --medium-gray: #e5e5e5;
    --dark-gray: #666666;
    --sidebar-width: 250px;
    --header-height: 70px;
    --success: #4CAF50;
    --warning: #ff9800;
    --danger: #f44336;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.dashboard-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(to bottom, var(--primary-darker), var(--primary-dark));
    color: var(--white);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

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

.sidebar-logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    font-size: 1.2rem;
}

.sidebar-profile {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: var(--primary-light);
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar i {
    font-size: 2rem;
    color: var(--primary-darker);
}

.profile-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-email {
    font-size: 0.85rem;
    opacity: 0.8;
    word-break: break-all;
}

.sidebar-menu {
    padding: 1.5rem 0;
}

.menu-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    padding: 0.75rem 1.5rem;
    opacity: 0.7;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--white);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary-light);
}

.menu-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: var(--white);
}

.menu-icon {
    margin-right: 1rem;
    width: 20px;
    text-align: center;
}

.create-homily-btn {
    margin: 1.5rem;
}

.create-homily-btn a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background-color: var(--white);
    color: var(--primary-darker);
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.create-homily-btn a:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.create-homily-btn i {
    margin-right: 0.5rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.current-plan-info {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.current-plan-info h4 {
    font-size: 0.9rem;
    margin: 0 0 0.5rem;
}

.plan-details {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.plan-name {
    font-weight: 600;
    margin-right: 0.5rem;
}

.plan-badge {
    font-size: 0.7rem;
    background-color: var(--primary-light);
    color: var(--primary-darker);
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    font-weight: bold;
}

.homilies-remaining {
    font-size: 0.85rem;
}

.update-plan-btn {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--white);
    text-decoration: underline;
    cursor: pointer;
}

/* Main Content Area */
.dashboard-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    background-color: var(--light-gray);
    transition: all 0.3s ease;
}

.dashboard-header {
    height: var(--header-height);
    background-color: var(--white);
    border-bottom: 1px solid var(--medium-gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.header-logo {
    margin-right: 1rem;
}

.small-logo {
    height: 40px;
    width: auto;
}

.header-title h2 {
    margin: 0;
    color: var(--primary-darker);
    font-size: 1.5rem;
    text-align: center;
}

/* Welcome Banner */
.welcome-banner {
    background-color: var(--primary-light);
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--medium-gray);
}

.welcome-message {
    color: var(--primary-darker);
    font-weight: 500;
    font-size: 1rem;
    text-align: center;
}

.header-actions {
    display: flex;
    align-items: center;
    position: absolute;
    right: 2rem;
}

.header-icon-btn {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark-gray);
    margin-left: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

#mobile-menu-toggle {
    display: none; /* Hide on desktop */
}

.header-icon-btn:hover {
    background-color: var(--light-gray);
    color: var(--primary-dark);
}

.dashboard-content {
    padding: 2rem;
}

.content-card {
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.content-title {
    margin: 0;
    color: var(--primary-darker);
}

.content-action {
    color: var(--primary-medium);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.content-action i {
    margin-left: 0.5rem;
}

/* Upgrade Plan Modal Styles */
.upgrade-modal-content {
    max-width: 900px;
}

.plan-comparison {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
}

.plan-card {
    flex: 1;
    border: 1px solid var(--medium-gray);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.plan-card.recommended {
    border-color: var(--primary-medium);
    box-shadow: 0 5px 15px rgba(100, 144, 211, 0.2);
}

.recommended-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-darker);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.plan-name {
    font-size: 1.5rem;
    color: var(--primary-darker);
    margin: 1rem 0;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.plan-billing {
    display: block;
    font-size: 0.9rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
}

.plan-features {
    margin: 1.5rem 0;
    text-align: left;
    padding-left: 0;
    list-style-type: none;
}

.plan-features li {
    margin-bottom: 0.75rem;
    position: relative;
}

.plan-features li .fas {
    color: var(--primary-dark);
    margin-right: 0.5rem;
}

.plan-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    width: 100%;
    margin-top: 1rem;
}

.plan-btn-primary {
    background-color: var(--primary-medium);
    color: var(--white);
    border: none;
}

.plan-btn-outline {
    background-color: transparent;
    color: var(--primary-darker);
    border: 1px solid var(--primary-medium);
}

.plan-btn-primary:hover {
    background-color: var(--primary-darker);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.plan-btn-outline:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Homily Cards */
.homily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.homily-card {
    background-color: var(--white);
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.homily-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #d0d0d0;
}

/* Card header with title and date */
.homily-card-header {
    background: linear-gradient(45deg, var(--primary-light), var(--primary-lighter));
    padding: 1.25rem 1.5rem;
    position: relative;
    border-bottom: 1px solid #e0e0e0;
}

.homily-card-title {
    margin: 0 0 0.5rem 0;
    color: var(--primary-darker);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    /* Allow long titles to wrap */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.homily-card-date {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

/* Passages section */
.homily-card-passages {
    padding: 1rem 1.5rem 0.5rem;
    font-style: italic;
    color: var(--primary-dark);
    border-bottom: 1px dashed #e8e8e8;
    font-size: 0.95rem;
    background-color: rgba(210, 196, 228, 0.1);
}

/* Preview text */
.homily-card-preview {
    padding: 1rem 1.5rem;
    flex: 1;
    height: 4.8em; /* Show exactly 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    color: var(--dark-gray);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Card actions */
.homily-card-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    background-color: #fafafa;
}

.btn-view-homily {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    font-size: 0.9rem;
    background: linear-gradient(45deg, var(--primary-dark), var(--primary));
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.btn-view-homily:hover {
    background: linear-gradient(45deg, var(--primary), var(--primary-medium));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Empty state styling */
.empty-state-message {
    text-align: center;
    padding: 2rem;
    color: var(--dark-gray);
    font-size: 1.1rem;
}

.empty-state-message a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.empty-state-message a:hover {
    text-decoration: underline;
}

/* Loading spinner styling */
.loading-spinner {
    display: block;
    width: 40px;
    height: 40px;
    margin: 2rem auto;
    border: 4px solid rgba(100, 144, 211, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Adjustments */
@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: var(--sidebar-width);
        z-index: 1000;
        transition: transform 0.3s ease;
    }
    
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }
    
    .dashboard-main.sidebar-active {
        margin-left: 0;
        width: 100%;
        position: relative;
    }
    
    .dashboard-main.sidebar-active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }
    
    .plan-comparison {
        flex-direction: column;
    }
    
    .homily-grid {
        grid-template-columns: 1fr;
    }
    
    .header-title {
        margin: 0 auto;
        justify-content: center;
    }
    
    .welcome-banner {
        padding: 0.75rem 1rem;
    }
    
    .header-actions {
        right: 1rem;
    }
    
    #mobile-menu-toggle {
        display: flex;
        color: var(--primary-darker);
        font-size: 1.2rem;
        background-color: var(--light-gray);
    }
    
    #mobile-menu-toggle:hover {
        background-color: var(--primary-light);
        color: var(--primary-darker);
    }
}

/* Animation Effects */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes slideInLeft {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-in-out;
}

/* Dashboard Footer */
.dashboard-footer {
    background-color: var(--white);
    border-top: 1px solid var(--medium-gray);
    padding: 1.5rem 2rem;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo {
    margin-bottom: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dashboard-footer-links {
    margin-top: 0.75rem;
}

.dashboard-footer-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.dashboard-footer-links a:hover {
    color: var(--primary-darker);
    text-decoration: underline;
}

.footer-content p {
    margin: 0;
    color: var(--dark-gray);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .dashboard-footer {
        margin-left: 0;
        width: 100%;
    }
}

/* Dashboard Sections */
.dashboard-section {
    display: none;
}

.dashboard-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Persistent Plan Information Bar */
.plan-info-bar {
    background-color: var(--primary-darker);
    color: var(--white);
    padding: 1rem 0;
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    bottom: 0;
    z-index: 98;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

.plan-info-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.plan-info-item {
    display: flex;
    align-items: center;
}

.plan-info-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-right: 0.5rem;
}

.plan-info-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.plan-info-upgrade-btn {
    background-color: var(--white);
    color: var(--primary-darker);
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.plan-info-upgrade-btn:hover {
    background-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .plan-info-bar {
        margin-left: 0;
        width: 100%;
    }
    
    .plan-info-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .plan-info-item {
        width: 100%;
        justify-content: space-between;
    }
    
    .plan-info-upgrade-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Enhanced Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: var(--white);
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: #aaa;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s ease;
}

.close-button:hover {
    color: #333;
}

.modal-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--medium-gray);
    text-align: right;
}

/* Tab styles for backward compatibility */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--medium-gray);
    margin-bottom: 2rem;
}

.tab-button {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    position: relative;
    color: var(--dark-gray);
    transition: color 0.3s;
}

.tab-button:hover {
    color: var(--primary-darker);
}

.tab-button.active {
    color: var(--primary-darker);
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-darker);
}

.tab-pane {
    display: none;
    padding: 1rem 0;
}

.tab-pane.active {
    display: block;
}

/* Additional responsive styles */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 10% auto;
    }
}

/* Add styles for admin-only elements */
.admin-only {
    display: none; /* Hidden by default */
}

body.is-admin .admin-only {
    display: flex; /* Show for admin users */
}

/* Homily Modal */
.homily-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
    transition: opacity 0.3s ease;
}

.homily-modal-content {
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 1100px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modal-slide-in 0.3s ease forwards;
}

@keyframes modal-slide-in {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.homily-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, var(--primary-light), var(--white));
}

.homily-modal-title {
    margin: 0;
    color: var(--primary-darker);
    font-size: 1.4rem;
    font-weight: 600;
    flex: 1;
}

.homily-search-container {
    position: relative;
    flex: 2;
    max-width: 400px;
    margin: 0 1.5rem;
}

.homily-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #d0d0d0;
    border-radius: 30px;
    background-color: white;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="%236490d3"><path d="M23.707,22.293l-5.969-5.969a10.016,10.016,0,1,0-1.414,1.414l5.969,5.969a1,1,0,0,0,1.414-1.414ZM10,18a8,8,0,1,1,8-8A8.009,8.009,0,0,1,10,18Z"/></svg>');
    background-repeat: no-repeat;
    background-position: 12px center;
}

.homily-search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(100, 144, 211, 0.2);
    outline: none;
}

.homily-modal-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--primary-dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.homily-modal-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-darker);
}

.homily-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    background-color: #f9f9f9;
}

/* No results message when search returns empty */
.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--dark-gray);
    font-size: 1.1rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
} 