/* CSS Variables from Microsoft Office Downloader */
:root {
    --bg-primary: #ffffff;
    --text-primary: #121212;
    --text-secondary: #424242;
    --text-muted: #757575;
    --border-color: #e0e0e0;
    --accent-color: #ff3b30;
    --bg-secondary: #f5f5f5;
    --bg-card: #ffffff;
    --dot-color: #e0e0e0;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --hover-shadow: rgba(0, 0, 0, 0.12);
    --tag-bg: #f5f5f5;
    --hover-bg: #f5f5f5;
    --brand-plus-color: #0078d4;
    --brand-text-color: #121212;
    --footer-bg: #f8f9fa;
    --footer-text: #495057;
    --footer-link: #007bff;
}

body.dark-mode {
    --bg-primary: #121212;
    --text-primary: #ffffff;
    --text-secondary: #e0e0e0;
    --text-muted: #9e9e9e;
    --border-color: #424242;
    --accent-color: #ff3b30;
    --bg-secondary: #1e1e1e;
    --bg-card: #1e1e1e;
    --dot-color: #424242;
    --card-shadow: rgba(0, 0, 0, 0.3);
    --hover-shadow: rgba(0, 0, 0, 0.5);
    --tag-bg: #2d2d2d;
    --hover-bg: #2d2d2d;
    --brand-plus-color: #ff3b30;
    --brand-text-color: #ffffff;
    --footer-bg: #1e1e1e;
    --footer-text: #e0e0e0;
    --footer-link: #4dabf7;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: "Anek Bangla", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    padding-top: 60px;
    font-weight: 300;
    transition:
        background-color 0.3s,
        color 0.3s;
}

/* Minimalist navbar */
.navbar {
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: none;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
    padding: 1rem 0;
    height: 60px;
    transition:
        background-color 0.3s,
        border-color 0.3s;
}

.navbar-brand {
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    padding: 0;
    margin-right: 20px;
    font-family: "Orbitron", sans-serif;
}

.navbar-brand img {
    height: 2.5rem;
    margin-right: 8px;
    border-radius: 50%;
}

.brand-plus {
    color: var(--brand-plus-color);
    font-weight: bold;
}

.brand-text {
    color: var(--brand-text-color);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
}

/* Search Bar */
.search-container {
    position: relative;
    width: 20rem;
}

.search-input {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 5px 12px;
    width: 100%;
    transition: border-color 0.2s;
}

.search-input:focus {
    background-color: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: none;
    outline: none;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Navigation Items */
.navbar-nav {
    flex-direction: row;
    align-items: center;
}

.navbar-nav .nav-item {
    margin: 0 4px;
}

.navbar-nav .nav-link {
    color: var(--text-primary) !important;
    font-weight: 400;
    padding: 8px 16px;
    border-radius: 6px;
    transition: none;
    font-size: 14px;
}

.navbar-nav .nav-link:hover {
    color: var(--accent-color) !important;
    background-color: var(--hover-bg);
}

/* Dropdown Menu */
.dropdown-menu {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--card-shadow);
    margin-top: 8px;
    padding: 8px 0;
    min-width: 200px;
}

.dropdown-item {
    color: var(--text-primary);
    font-weight: 400;
    padding: 8px 16px;
    transition: none;
    font-size: 14px;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

.dropdown-divider {
    border-top: 1px solid var(--border-color);
    margin: 8px 0;
}

/* Multi-level dropdown styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu .dropdown-menu {
    top: 0;
    left: 100%;
    margin-top: -1px;
}

/* Footer Styles */
footer {
    background-color: var(--footer-bg);
    padding: 50px 0 30px;
    border-top: 1px solid var(--border-color);
    color: var(--footer-text);
    margin-top: 50px;
    font-weight: 400;
}

footer h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

footer p {
    margin-bottom: 20px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links li {
    display: inline-block;
}

.footer-links a {
    color: var(--footer-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.social-button {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    text-decoration: none;
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.facebook-btn:hover {
    background-color: #1877f2;
    color: white;
    border-color: #1877f2;
    transform: translateY(-3px);
}

.whatsapp-btn:hover {
    background-color: #25d366;
    color: white;
    border-color: #25d366;
    transform: translateY(-3px);
}

.telegram-btn:hover {
    background-color: #0088cc;
    color: white;
    border-color: #0088cc;
    transform: translateY(-3px);
}

.youtube-btn:hover {
    background-color: #ff0000;
    color: white;
    border-color: #ff0000;
    transform: translateY(-3px);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .navbar-collapse {
        background-color: var(--bg-primary);
        padding: 10px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }
    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
    }
    .navbar-nav .nav-item {
        width: 100%;
        margin: 4px 0;
    }
    .search-container {
        width: 100% !important;
        margin-top: 10px;
    }
    .theme-toggle {
        margin-left: 0;
    }
    .footer-links {
        flex-direction: column;
        align-items: center;
    }
}

/* App Specific Styles */
.app-container {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 12px var(--card-shadow);
    margin-bottom: 2rem;
}

.app-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-family: "Orbitron", sans-serif;
}

.control-panel {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-select,
.form-control {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.form-select:focus,
.form-control:focus {
    background-color: var(--bg-primary);
    border-color: var(--accent-color);
    box-shadow: none;
    color: var(--text-primary);
}

/* Compact form controls */
.form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* Round color inputs */
.color-input {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    padding: 0;
    cursor: pointer;
    background: none;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 50%;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin: 1rem 0;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--accent-color);
    background-color: var(--hover-bg);
}

.upload-area.dragover {
    border-color: var(--accent-color);
    background-color: var(--hover-bg);
}

.preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    position: relative;
}

.preview-page {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 8px var(--card-shadow);
    overflow: hidden;
    position: relative;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.preview-canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.page-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.25rem;
    font-size: 0.8rem;
    text-align: center;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-download {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-download:hover {
    background-color: #d6321f;
    transform: translateY(-2px);
}

.btn-download:disabled {
    background-color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.progress-container {
    margin-top: 1rem;
    display: none;
}

.progress {
    height: 8px;
    background-color: var(--hover-bg);
}

.progress-bar {
    background-color: var(--accent-color);
}

.info-message {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
}

.info-success {
    background-color: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.info-error {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.info-info {
    background-color: rgba(23, 162, 184, 0.1);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
}

.photo-list-container {
    max-height: 300px; /* Fixed height for scrollable area */
    overflow-y: auto; /* Enable vertical scrolling */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 10px;
    margin-top: 1rem;
    background-color: var(--bg-primary);
}

.photo-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-secondary); /* Slightly different background for items */
}

.photo-item:last-child {
    margin-bottom: 0;
}

.photo-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    margin-right: 10px;
    border-radius: 4px;
}

.photo-item .photo-details {
    flex-grow: 1;
}

.photo-item .photo-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.photo-item .photo-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.photo-item .copy-input {
    width: 60px; /* Smaller input for copies */
    margin-left: 10px;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
}

.photo-item .remove-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 1rem;
    margin-left: 8px;
    cursor: pointer;
    padding: 0;
}
.photo-item .remove-btn:hover {
    color: #d6321f;
}

/* No more collapsible sections, so these styles are less relevant but kept for consistency */
.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.collapsible-header h5 {
    margin: 0;
}

.collapsible-header i {
    transition: transform 0.3s;
}

.collapsible-content {
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    max-height: 500px; /* Initial max-height for open state */
}

.collapsed .collapsible-header i {
    transform: rotate(180deg);
}

.collapsed .collapsible-content {
    max-height: 0;
}

/* Zoom Button */
.zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
}
.zoom-button:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Modal for Zoomed Preview */
.modal-content {
    background-color: var(--bg-card);
    color: var(--text-primary);
}
.modal-header {
    border-bottom-color: var(--border-color);
}
.modal-footer {
    border-top-color: var(--border-color);
}
.modal-body {
    text-align: center;
    overflow-x: auto; /* Allow horizontal scroll for large images */
}
#zoomedCanvas {
    max-width: 100%; /* Ensure it fits within modal */
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Floating Action Buttons */
.floating-buttons-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.floating-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition:
        background-color 0.2s,
        transform 0.2s;
}

.floating-button:hover {
    background-color: #d6321f;
    transform: translateY(-2px);
}

.floating-stats-button {
    background-color: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 25px; /* Pill shape */
    padding: 10px 15px;
    font-size: 0.9rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.floating-stats-button:hover {
    background-color: var(--hover-bg);
}

.info-icon-button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    cursor: pointer;
    margin-left: 5px;
    padding: 0;
}
.info-icon-button:hover {
    color: var(--accent-color);
}
