/* Admin Panel Styles */

.admin-container {
    width: 1000px;
    max-width: 95vw;
    height: 85vh;
    max-height: 900px;
    padding: 0;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    z-index: 10;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Login Container (similar to admin-container for consistency) */
.login-container {
    max-width: 400px;
    padding: 40px;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--secondary-color);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    position: relative;
    z-index: 10;
}

.login-container h1 {
    font-size: 1.8em;
    margin-bottom: 30px;
    text-align: center;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 40px 20px;
    border-bottom: 1px solid var(--secondary-color);
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 20px;
}

.admin-header-title {
    flex: 0 0 auto;
}

.admin-title-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header h1 {
    font-size: 1.8em;
    margin: 0;
}

.admin-nav-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.admin-nav-toggle:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: scale(1.1);
}

.admin-nav-toggle svg {
    display: block;
    transition: transform 0.3s ease;
}

.admin-nav-toggle.expanded svg {
    transform: rotate(180deg);
}

.welcome-text {
    color: var(--secondary-color);
    font-size: 0.9em;
    margin-bottom: 10px;
}



.admin-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.admin-nav .nav-item {
    padding: 10px 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    border: 1px solid var(--secondary-color);
    border-radius: 2px;
    white-space: nowrap;
}

.admin-nav .nav-item:hover {
    color: var(--text-color);
    border-color: var(--text-color);
}

.admin-nav .nav-item.active {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(0, 255, 255, 0.1);
}

.admin-nav .nav-item.logout {
    background: rgba(255, 0, 0, 0.2);
    border-color: #ff0000;
    color: #ff6666;
}

.admin-nav .nav-item.logout:hover {
    background: rgba(255, 0, 0, 0.4);
    color: #ff0000;
    border-color: #ff0000;
}

.admin-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.admin-section {
    margin: 0 0 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 2px;
}

.admin-section::-webkit-scrollbar {
    height: 10px;
}

.admin-section::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.admin-section::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.admin-section::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section h2 {
    color: var(--primary-color);
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.section-header h2 {
    margin: 0;
    border: none;
    padding: 0;
}



.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #444;
    padding: 20px;
    text-align: center;
    border-radius: 2px;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

.stat-number {
    font-size: 2.5em;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 10px;
}

.stat-label {
    color: var(--secondary-color);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.action-btn {
    padding: 15px 20px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    text-align: center;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 2px;
    transition: all 0.3s;
    display: block;
}

.action-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transform: translateY(-2px);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid #333;
}

.info-table td {
    padding: 12px 0;
    color: var(--text-color);
}

.info-table td:first-child {
    color: var(--secondary-color);
    width: 200px;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 0.85em;
    border-radius: 2px;
}

/* Form Styles for Admin */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1em;
    border-radius: 2px;
    box-sizing: border-box;
}

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

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    font-family: var(--font-family);
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--text-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-color);
}

.btn-danger {
    background: rgba(255, 0, 0, 0.2);
    color: #ff6666;
    border: 1px solid #ff0000;
}

.btn-danger:hover {
    background: rgba(255, 0, 0, 0.4);
    color: #252222;
}

.success-message {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #00ff00;
    color: #66ff66;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 2px;
    font-size: 0.9em;
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff6666;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 2px;
    font-size: 0.9em;
}

/* Portfolio Table Styles */
.portfolio-table-wrapper {
    width: 100%;
    border: 1px solid #333;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.3);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) rgba(0, 0, 0, 0.5);
}

.portfolio-table-wrapper::-webkit-scrollbar {
    height: 10px;
}

.portfolio-table-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.5);
}

.portfolio-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.portfolio-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.portfolio-table th,
.portfolio-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #333;
}

.portfolio-table th {
    background: rgba(0, 0, 0, 0.5);
    color: var(--primary-color);
    font-weight: normal;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
}

.portfolio-table tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

.thumbnail-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid var(--secondary-color);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .admin-container {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        border: none;
    }

    .admin-header {
        padding: 20px 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        align-items: center;
        align-content: center;
    }

    .admin-header > div {
        width: 100%;
    }

    .admin-header-title {
        width: 100%;
        margin-bottom: 15px;
        align-self: center;
    }
    
    .admin-nav-toggle {
        display: block; /* Show toggle button on mobile */
    }

    .admin-header h1 {
        font-size: 1.5em;
        line-height: 1.3;
    }

    .welcome-text {
        font-size: 0.75em;
        margin-bottom: 5px;
    }

    .btn-logout {
        align-self: flex-end;
        font-size: 0.7em;
        padding: 5px 12px;
        letter-spacing: 0.5px;
    }
    
    .admin-nav {
        display: flex;
        padding: 0 18px;
        overflow: visible;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: var(--primary-color) transparent;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        max-height: 1000px; /* Large enough for all items */
        transition: max-height 0.4s ease, opacity 0.4s ease, padding 0.4s ease, margin 0.4s ease;
        opacity: 1;
        margin-bottom: 10px;
    }
    
    .admin-nav.collapsed {
        max-height: 0 !important;
        opacity: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
        pointer-events: none;
        border: none;
    }

    .admin-nav::-webkit-scrollbar {
        height: 3px;
    }

    .admin-nav::-webkit-scrollbar-track {
        background: transparent;
    }

    .admin-nav::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 2px;
    }

    .admin-nav .nav-item {
        width: -webkit-fill-available;
        text-align: center;
        padding: 12px 15px;
        
        font-size: 0.8em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .admin-content-wrapper {
        padding: 18px;
    }

    .admin-section {
        padding: 15px;
    }

    .admin-section h2 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        margin-bottom: 15px;
    }

    .section-header h2 {
        font-size: 1.1em;
    }

    .btn-add {
        font-size: 0.8em;
        padding: 8px 16px;
        width: auto;
        align-self: stretch;
        text-align: center;
    }

    .form-group label {
        font-size: 0.85em;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.9em;
    }

    .btn-primary,
    .btn-secondary,
    .btn-danger {
        font-size: 0.85em;
        padding: 10px 20px;
    }

    .portfolio-table-wrapper {
        border: 1px solid #444;
    }

    .portfolio-table {
        font-size: 0.75em;
        min-width: 600px;
    }

    .portfolio-table th,
    .portfolio-table td {
        padding: 6px 8px;
        font-size: 0.85em;
    }

    .thumbnail-preview {
        width: 35px;
        height: 35px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 4px;
        min-width: 80px;
    }

    .action-buttons .btn-secondary,
    .action-buttons .btn-danger {
        width: 100%;
        text-align: center;
        font-size: 0.7em;
        padding: 5px 8px;
        letter-spacing: 0.5px;
    }
    
    /* Login container responsive */
    .login-container {
        max-width: 100%;
        padding: 18px;
        border-radius: 0;
        border: none;
    }
    
    /* Tools container responsive - convert to tabs */
    .tools-container {
        flex-direction: column;
        min-height: auto;
        gap: 0;
    }
    
    .tools-sidebar {
        flex: 0 0 auto;
        width: 100%;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
    }
    
    .tools-sidebar h3 {
        display: none; /* Hide "Available Tools" heading on mobile */
    }
    
    .tool-btn {
        display: inline-block;
        width: auto;
        padding: 10px 15px;
        margin: 5px 5px 5px 0;
        font-size: 0.8em;
        border-radius: 20px;
        transform: none; /* Remove translateX animation on mobile */
    }
    
    .tool-btn:hover {
        transform: none;
    }
    
    .tool-btn.active {
        background: var(--primary-color);
        color: var(--bg-color);
        border-color: var(--primary-color);
    }
    
    .tool-btn::before {
        display: none; /* Remove arrow on mobile */
    }
    
    .tools-content {
        max-height: none;
        padding: 15px;
        margin-top: 10px;
        border-radius: 2px;
    }
    
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .tool-header h2 {
        font-size: 1.1em;
    }
    
    .tool-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .tool-action-btn {
        flex: 1;
        min-width: 120px;
        text-align: center;
        font-size: 0.8em;
        padding: 10px 12px;
    }
    
    .log-content {
        font-size: 0.75em;
        max-height: 200px;
        padding: 10px;
    }
    
    .info-grid {
        font-size: 0.8em;
        gap: 8px 15px;
    }
}

/* Login Form Styles */
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="email"] {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--secondary-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1em;
    border-radius: 2px;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--bg-color);
    border: none;
    font-family: var(--font-family);
    font-size: 1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 2px;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--text-color);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.btn-login:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-login:disabled:hover {
    background: #333;
    box-shadow: none;
}

.error-message {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff0000;
    color: #ff6666;
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 2px;
    font-size: 0.9em;
    line-height: 1.5;
}

.error-message.warning {
    background: rgba(255, 165, 0, 0.1);
    border-color: #ff9900;
    color: #ffaa44;
}

.error-message strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1em;
}

.countdown {
    font-weight: bold;
    color: var(--primary-color);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.85em;
}

.back-link:hover {
    color: var(--primary-color);
}

/* Portfolio Table Styles */
.portfolio-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.portfolio-table th,
.portfolio-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #333;
}

.portfolio-table th {
    color: var(--primary-color);
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.portfolio-table td {
    color: var(--text-color);
}

.portfolio-table tr:hover {
    background: rgba(0, 255, 255, 0.05);
}

.type-badge {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    font-size: 0.85em;
    text-transform: uppercase;
}

.action-link {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 5px;
    font-family: var(--font-family);
    font-size: 0.85em;
    text-decoration: none;
    border-radius: 2px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    background: none;
}

.edit-link {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.edit-link:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.delete-link {
    background: rgba(255, 0, 0, 0.1);
    color: #ff6666;
    border: 1px solid #ff0000;
}

.delete-link:hover {
    background: rgba(255, 0, 0, 0.2);
    color: #ff0000;
}

/* Tools Section Styles */
.tools-container {
    display: flex;
    gap: 20px;
    min-height: 500px;
}

.tools-sidebar {
    flex: 0 0 200px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 2px;
    padding: 15px;
    justify-items: : center;
}

.tools-sidebar h3 {
    color: var(--secondary-color);
    font-size: 0.9em;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tool-btn {
    display: block;
    width: -webkit-fill-available;
    
    padding: 12px 15px;
    margin-bottom: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    color: var(--primary-color);
    text-decoration: none;
    text-align: left;
    border-radius: 2px;
    transition: all 0.3s ease;
    font-size: 0.9em;
}

.tool-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--secondary-color);
    transform: translateX(5px);
}

.tool-btn.active {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--secondary-color);
    font-weight: bold;
}

.tool-btn::before {
    content: '▸ ';
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-btn.active::before,
.tool-btn:hover::before {
    opacity: 1;
}

.tools-content {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 2px;
    padding: 20px;
    overflow-y: auto;
    max-height: 700px;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--secondary-color);
}

.tool-header h2 {
    color: var(--secondary-color);
    margin: 0;
    font-size: 1.4em;
}

.tool-actions {
    display: flex;
    gap: 10px;
}

.tool-action-btn {
    padding: 8px 15px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: 2px;
    font-size: 0.85em;
    transition: all 0.3s ease;
    cursor: pointer;
    font-family: var(--font-family);
}

.tool-action-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.log-section {
    margin-bottom: 30px;
}

.log-section h3 {
    color: var(--primary-color);
    font-size: 1.1em;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.log-path {
    font-size: 0.85em;
    color: #888;
    font-family: monospace;
    margin-bottom: 10px;
}

.log-content {
    background: #000;
    color: #0ff;
    padding: 15px;
    border: 1px solid #333;
    border-radius: 2px;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 0.85em;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

.log-content.empty {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

.success-message {
    background: rgba(0, 255, 0, 0.1);
    border: 1px solid #0f0;
    color: #0f0;
    padding: 12px 15px;
    border-radius: 2px;
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    font-family: monospace;
    font-size: 0.9em;
}

.info-label {
    color: var(--secondary-color);
    font-weight: bold;
}

.info-value {
    color: var(--primary-color);
}

.badge.success {
    background: rgba(0, 255, 0, 0.2);
    border-color: #0f0;
    color: #0f0;
}

.badge.error {
    background: rgba(255, 0, 0, 0.2);
    border-color: #f00;
    color: #f00;
}