/* Wordlist Card Styles */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.card-col {
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.card-col:hover {
    transform: translateY(-5px);
}

.week-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.week-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
    border-radius: 12px 12px 0 0;
}

.week-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.week-card .card-header {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 1.25rem;
    text-align: center;
    padding-bottom: 0.75rem;
    border-bottom: 2px dashed var(--border-secondary);
}

.card-preview {
    padding: 0.75rem 0;
    border-bottom: 2px dashed var(--border-secondary);
    margin-bottom: 1rem;
}

.word-preview {
    color: var(--text-body);
    font-size: 0.9rem;
    margin-bottom: 0;
    line-height: 1.4;
}

.word-count {
    color: var(--primary-cactus);
    font-size: 0.85rem;
    font-weight: 600;
}

.week-card .btn-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.week-btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.week-btn i {
    margin-right: 8px;
}

.week-btn:hover {
    transform: translateY(-2px);
}

.week-btn.btn-outline-primary {
    background-color: rgba(123, 193, 66, 0.1);
    color: var(--primary-cactus);
    border: 2px solid var(--primary-cactus);
}

.week-btn.btn-primary {
    background: var(--gradient-secondary);
}

.week-btn.btn-primary:hover {
    background: linear-gradient(135deg, #FF5722 0%, #FF8F00 100%);
    box-shadow: 0 6px 12px rgba(255, 107, 53, 0.4);
}

/* AdSense Card */
.adsense-card {
    background: var(--bg-primary);
    border: 2px dashed var(--border-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    font-size: 1.5rem;
    color: var(--text-body);
    text-align: center;
    padding: 1.5rem;
    font-weight: 700;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.adsense-card::after {
    content: "Ad";
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-vibrant);
    color: white;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: bold;
}

.btn-custom {
    background-color: #49B3A7;
    border-color: #49B3A7;
    color: white;
}

.btn-custom:hover {
    background-color: #3d9a8f;
    border-color: #3d9a8f;
    color: white;
}

.btn-custom:focus {
    background-color: #3d9a8f;
    border-color: #3d9a8f;
    color: white;
    box-shadow: 0 0 0 0.25rem rgba(73, 179, 167, 0.25);
}

.btn-custom:active {
    background-color: #3d9a8f !important;
    border-color: #3d9a8f !important;
    color: white !important;
}

/* Study Cards Modal Styles */
.study-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 1;
}

.study-card.card-opaque {
    opacity: 0.3;
}

.study-card .card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    border-radius: 12px 12px 0 0;
    border: none;
}

.study-card .word-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.study-card .card-info {
    padding: 1rem;
    flex: 1;
}

.study-card .info-section {
    margin-bottom: 0.5rem;
}

.study-card .info-section.hide {
    display: none;
}

.study-card .info-section.show {
    display: block;
}

.study-card .card-actions {
    padding: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    border-top: 1px solid #eee;
}

.study-card .btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-body);
    background: transparent;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.study-card .btn-icon:hover {
    background: var(--bg-secondary);
    color: var(--primary-vibrant);
    border-color: var(--primary-vibrant);
}

/* Study Cards Grid */
.study-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.study-card-col {
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.study-card-col:hover {
    transform: translateY(-5px);
}

/* Word Details Sidebar */
.word-details-sidebar {
    position: fixed;
    top: 0;
    right: -400px; /* Start hidden */
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1060;
    padding: 2rem;
    overflow-y: auto;
}

.word-details-sidebar.active {
    right: 0;
}

.word-details-sidebar .sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.word-details-sidebar .selected-word {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.word-details-sidebar .close-sidebar {
    background: none;
    border: none;
    color: var(--text-body);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
}

.word-details-sidebar .close-sidebar:hover {
    color: var(--primary-vibrant);
}

.word-details-sidebar .detail-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.word-details-sidebar .detail-section h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.word-details-sidebar .detail-section h4 i {
    color: var(--primary-vibrant);
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.word-details-sidebar .detail-section h4 i:hover {
    transform: scale(1.1);
}

.word-details-sidebar .detail-section p {
    color: var(--text-body);
    margin: 0;
    line-height: 1.6;
    font-size: 1rem;
}

/* Adjust modal body when sidebar is active */
.study-cards-modal .modal-body.sidebar-active {
    margin-right: 400px;
    transition: margin-right 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: 1fr;
    }

    .word-details-sidebar {
        width: 100%;
        right: -100%;
    }

    .study-cards-modal .modal-body.sidebar-active {
        margin-right: 0;
    }

    .study-card .word-title {
        font-size: 1.1rem;
    }

    .study-card .card-info {
        padding: 0.75rem;
    }

    .study-card .card-actions {
        padding: 0.5rem;
    }

    .study-card .btn-icon {
        width: 32px;
        height: 32px;
    }

    .study-cards-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) and (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .study-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1201px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .study-cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1400px) {
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .study-cards-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 1.25rem 1.5rem;
    border: none;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-title {
    font-weight: 600;
    font-size: 1.25rem;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 100vh;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
    border-radius: 0 0 16px 16px;
}

/* PDFs Modal */
.pdfs-modal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pdfs-modal .modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
    border: none;
    text-align: center;
}

.pdfs-modal .modal-title {
    font-weight: 700;
    font-size: 1.5rem;
    width: 100%;
    margin: 0;
}

.pdfs-modal .modal-body {
    padding: 2rem;
    max-height: 80vh;
    overflow-y: auto;
}

.pdfs-modal .card-body {
    padding: 0;
}

.pdfs-modal .printPop {
    color: var(--text-heading);
    font-weight: 600;
    font-size: 1.1rem;
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.pdfs-modal .printPop:first-child {
    margin-top: 0;
}

.pdfs-modal .printPop2 {
    margin: 1.5rem 0;
    border-color: var(--border-secondary);
    opacity: 0.5;
}

.pdfs-modal .btn-app2 {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    margin: 0.5rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-heading);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.pdfs-modal .btn-app2:hover {
    background: var(--bg-primary);
    color: var(--primary-vibrant);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: var(--primary-vibrant);
}

.pdfs-modal .btn-app2 i {
    font-size: 1.1rem;
    color: var(--primary-vibrant);
}

.pdfs-modal .btn-app2:hover i {
    transform: scale(1.1);
}

/* Study Cards Modal */
.study-cards-modal .modal-content {
    background: #f8f9fa;
    border: none;
    border-radius: 0;
}

.study-cards-header {
    background: var(--gradient-primary);
    padding: 1rem;
    border: none;
}

.study-cards-header .header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex: 1;
}

.study-cards-header .logo {
    width: 120px;
}

.study-cards-header .logo img {
    width: 100%;
    height: auto;
}

.study-cards-header .title-section {
    color: white;
    flex: 1;
}

.study-cards-header .modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.study-cards-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.study-cards-header .word-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

.study-cards-header .header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.study-cards-header .filter-select {
    width: 150px;
    background: white;
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--primary-vibrant);
}

.study-cards-header .filter-select option {
    background: var(--gradient-primary);
    color: var(--primary-vibrant);
}

.study-cards-body {
    padding: 2rem;
    overflow-y: auto;
}

.study-cards-footer {
    padding: 0;
    border: none;
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transform: scale(0.95);
    transition: transform 0.2s ease-out;
}

.modal.show .modal-dialog {
    transform: scale(1);
}

/* Copy Button Animation */
.modal-footer .btn-primary {
    transition: all 0.3s ease;
}

.modal-footer .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-footer .btn-primary.btn-success {
    background: var(--primary-cactus);
    border-color: var(--primary-cactus);
}

/* Media Queries */
@media (max-width: 768px) {
    .study-cards-header .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .study-cards-header .header-actions {
        width: 100%;
        justify-content: center;
    }

    .study-cards-body {
        padding: 1rem;
    }

    .study-cards-header .logo {
        width: 100px;
    }

    .study-cards-header .modal-title {
        font-size: 1.25rem;
    }

    .study-cards-header .subtitle {
        font-size: 1rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 0.75rem 1rem;
    }

    .pdfs-modal .modal-body {
        padding: 1rem;
    }

    .pdfs-modal .btn-app2 {
        width: 100%;
        margin: 0.5rem 0;
        justify-content: flex-start;
    }

    .pdfs-modal .printPop {
        font-size: 1rem;
        margin: 1.25rem 0 0.75rem;
    }
}

/* Words List */
.words-list {
    display: grid;
    gap: 0.75rem;
    padding: 0.5rem;
}

.word-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.word-item:hover {
    background: var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.word-number {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 2rem;
}

.word-text {
    font-size: 1.1rem;
    color: var(--text-heading);
    font-weight: 500;
}

.word-item .word-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.word-item .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-body);
    background: transparent;
    border: 1px solid #eee;
    transition: all 0.2s ease;
}

.word-item .btn-icon:hover {
    background: var(--bg-primary);
    color: var(--primary-vibrant);
    border-color: var(--primary-vibrant);
}

.word-item .btn-icon i {
    font-size: 1rem;
}

.word-item .word-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-body);
}

.word-item .word-status i {
    font-size: 1rem;
}

.word-item .word-status.correct {
    color: var(--primary-cactus);
}

.word-item .word-status.incorrect {
    color: var(--primary-vibrant);
}

.word-item .word-status.pending {
    color: var(--text-muted);
}

/* Word List Container */
.word-list-container {
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.word-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.word-list-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
}

.word-list-actions {
    display: flex;
    gap: 1rem;
}

.word-list-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.word-list-filters select {
    min-width: 150px;
    padding: 0.5rem;
    border: 1px solid var(--border-secondary);
    border-radius: 6px;
    background: var(--bg-primary);
    color: var(--text-heading);
}

.word-list-filters .btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 500;
}

.word-list-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-body);
}

.word-list-empty i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.word-list-empty p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(-15px);
    }
    60% {
      transform: translateY(-7px);
    }
}

.ad-bounce {
    animation: bounce 1s ease infinite;
}

/* Media Queries */
@media (max-width: 768px) {
    .word-list-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .word-list-actions {
        width: 100%;
        justify-content: center;
    }

    .word-list-filters {
        flex-direction: column;
    }

    .word-list-filters select {
        width: 100%;
    }

    .word-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .word-item .word-actions {
        margin-left: 0;
        width: 100%;
        justify-content: flex-end;
    }

    .word-item .word-status {
        width: 100%;
        justify-content: flex-end;
    }

    .word-list-container {
        padding: 1rem;
    }

    .word-list-title {
        font-size: 1.25rem;
    }
}

.ad-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-heading);
}

.ad-card .card-header i {
    color: var(--primary-vibrant);
    font-size: 1.1em;
}

/* Loading Animation */
@keyframes loadingDots {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

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

/* Loading Styles */
.error-message {
    text-align: center;
    color: #dc3545;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.error-message p {
    margin-bottom: 1rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-text {
    font-size: 1.2rem;
    color: #666;
}

.loading-text span {
    animation: loadingDots 1.4s infinite;
    opacity: 0;
}

.loading-text span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-text span:nth-child(3) {
    animation-delay: 0.4s;
}

.retry-button {
    margin-top: 1rem;
}

.study-cards-body {
    position: relative;
    min-height: 300px;
}

.study-cards-container {
    position: relative;
    width: 100%;
}

.study-cards-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
}

.ad-card .btn-primary {
    background: linear-gradient(135deg, #FF5722 0%, #FF8F00 100%);
    border: none;
    color: white;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ad-card .btn-primary:hover {
    background: white;
    color: #FF5722;
    border: 2px solid #FF5722;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.2);
}

.ad-card .btn-primary:active {
    background: white !important;
    color: #FF5722 !important;
    border-color: #FF5722 !important;
}

.ad-card .btn-primary:focus {
    background: white;
    color: #FF5722;
    border-color: #FF5722;
    box-shadow: 0 0 0 0.25rem rgba(255, 87, 34, 0.25);
} 