/**
 * Picons Browser - Main Stylesheet
 * Modern, clean design for icon browser interface
 */

/* ===== Global Styles ===== */
* {
    box-sizing: border-box;
}

body {
    padding: 20px;
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* ===== Login Page Styles ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-panel {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.login-panel .panel-heading {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
}

.login-panel .panel-heading h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.login-panel .panel-body {
    padding: 30px;
}

.login-panel .form-control {
    height: 45px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    padding: 10px 15px;
    transition: border-color 0.3s;
}

.login-panel .form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-panel .btn-login {
    height: 45px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 4px;
    color: #fff;
    width: 100%;
    margin-top: 15px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.login-panel .btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.login-panel .btn-login:active {
    transform: translateY(0);
}

.error-message {
    background-color: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

.lockout-message {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    font-weight: 600;
}

.delay-warning {
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 12px 15px;
    border-radius: 4px;
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
}

/* ===== Main Application Styles ===== */
.app-header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.app-stats {
    color: #666;
    font-size: 14px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-counter {
    padding: 8px 12px;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
    background: #f8f9fa;
    border-radius: 4px;
}

.logout-btn {
    height: 40px;
    padding: 0 20px;
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* ===== Table Styles ===== */
.table-container {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.results {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.results thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.results thead th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.results tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.results tbody tr:hover {
    background-color: #f8f9fa;
}

.results tbody tr:last-child {
    border-bottom: none;
}

.results tbody td,
.results tbody th {
    padding: 15px;
    vertical-align: middle;
}

.results tbody th {
    font-weight: 600;
    color: #666;
    width: 60px;
}

.results tr[visible='false'] {
    display: none;
}

.results tr[visible='true'] {
    display: table-row;
}

.no-result {
    display: none;
    background-color: #fff3cd;
}

.no-result td {
    text-align: center;
    padding: 20px;
    color: #856404;
    font-size: 14px;
}

.no-result i {
    margin-right: 8px;
}

/* ===== Icon Display ===== */
.icon-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 4px;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
    position: relative;
    cursor: pointer;
}

/* Hover zoom effect for desktop devices only */
@media (hover: hover) and (pointer: fine) {
    .icon-thumbnail:hover {
        transform: scale(3.5);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
        z-index: 1000;
        transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
    }
}

.icon-name {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* ===== Button Styles ===== */
.btn-copy {
    padding: 8px 16px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.btn-copy:active {
    transform: translateY(0);
}

.btn-copy.copied {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

/* ===== Link Display ===== */
.icon-link {
    font-size: 13px;
    color: #667eea;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .app-header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-container {
        max-width: 100%;
        order: 1;
    }

    .app-title {
        order: 0;
        text-align: center;
    }

    .logout-btn {
        order: 2;
        width: 100%;
    }

    .results thead th,
    .results tbody td,
    .results tbody th {
        padding: 10px 8px;
        font-size: 12px;
    }

    .icon-thumbnail {
        width: 48px;
        height: 48px;
    }

    .icon-name {
        font-size: 12px;
    }

    .btn-copy {
        padding: 6px 12px;
        font-size: 12px;
    }

    .icon-link {
        font-size: 11px;
    }

    /* Stack table on mobile for better readability */
    .results thead {
        display: none;
    }

    .results tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        overflow: hidden;
    }

    .results tbody td,
    .results tbody th {
        display: block;
        text-align: left;
        padding: 10px 15px;
        border: none;
    }

    .results tbody th {
        background: #f8f9fa;
        font-weight: 700;
        border-bottom: 1px solid #e9ecef;
    }

    .results tbody td {
        position: relative;
        padding-left: 40%;
    }

    .results tbody td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        font-weight: 600;
        color: #666;
        font-size: 12px;
        text-transform: uppercase;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 20px;
    }

    .search-counter {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* ===== Loading Spinner ===== */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

.loading-indicator {
    text-align: center;
    padding: 30px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.loading-indicator p {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* ===== Utility Classes ===== */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 10px;
}

.mt-3 {
    margin-top: 15px;
}

.mb-2 {
    margin-bottom: 10px;
}

.mb-3 {
    margin-bottom: 15px;
}

.hidden {
    display: none;
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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