/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: Arial, sans-serif; 
    line-height: 1.6; 
    color: #f4f4f4; 
    background-color: #333;
    padding-top: 60px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container { 
    width: 95%; 
    max-width: 1200px;
    margin: 0 auto; 
    padding: 20px; 
    flex-grow: 1;
}

/* Header and Navigation */
header {
    background-color: #1a1a1a;
    color: white;
    padding: 5px 20px; 
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7em; 
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 50px; 
}

.header-content {
    display: flex;
    align-items: center;
}

.header-icon {
    width: 25px; 
    height: 25px; 
    margin-right: 5px; 
}

.title-version {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

h1 {
    font-size: 1.4em;
    margin: 0;
}

nav {
    display: flex;
    align-items: center;
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    left: 50%;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

nav ul li {
    margin: 0 10px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 1.3em;
    padding: 5px 8px;
    transition: color 0.3s ease;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: #FFA500;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

nav ul li a:hover {
    color: #FFA500;
}

nav ul li a:hover::after {
    transform: scaleX(1);
}

.header-controls {
    display: flex;
    align-items: center;
}

.action-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.action-controls .icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
    padding: 8px 12px;
    min-width: 120px;
    height: 36px;
}

.action-controls .icon-button i {
    margin-right: 5px;
}

.action-controls .icon-button:hover {
    opacity: 0.9;
}

/* Common Form and Button Styles */
form, .provider-card, #addItemForm, #itemTable {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

input[type="text"], input[type="number"] {
    width: 100%;
    padding: 8px;
    background-color: #444;
    border: 1px solid #666;
    color: #fff;
    border-radius: 3px;
    font-family: inherit;
}

button, .icon-button, .toggleDetails, .deleteItem {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    border-radius: 3px;
    transition: background-color 0.3s, opacity 0.3s;
}

button:hover, .icon-button:hover, .toggleDetails:hover {
    opacity: 0.9;
}

/* Table Styles */
#itemTable {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

#itemTable th, #itemTable td {
    border: 1px solid #444;
    padding: 12px;
    text-align: left;
}

#itemTable th {
    background-color: #1a1a1a;
    color: #2a2a2a;
    font-weight: bold;
}

/* Provider and Stats Styles */
.provider-grid, .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
}

.stat-card h3 {
    margin-bottom: 10px;
    font-size: 1.2em;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #4CAF50;
}

.stats-display {
    display: flex;
}

.stat-item {
    margin-left: 15px;
    font-size: 0.9em;
    white-space: nowrap;
}

.stat-item i {
    margin-right: 5px;
}

.provider-card {
    background-color: #444;
    border-radius: 5px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.provider-name {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.provider-status {
    margin-bottom: 10px;
}

.provider-actions {
    margin-top: auto;
}

.provider-actions button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.provider-actions .enable-btn {
    background-color: #4CAF50;
    color: white;
}

.provider-actions .disable-btn {
    background-color: #f44336;
    color: white;
}

.provider-actions button:hover {
    opacity: 0.9;
}

.provider-rankings {
    margin-top: 10px;
}

.provider-rankings label {
    display: block;
    margin-bottom: 5px;
}

.provider-rankings input[type="number"] {
    width: 60px;
    padding: 5px;
    border: 1px solid #666;
    background-color: #333;
    color: #fff;
    border-radius: 3px;
}

.none-provider {
    background-color: #555;
    color: #fff;
}

.provider-actions .disabled-btn {
    background-color: #888;
    color: #ccc;
    cursor: not-allowed;
}

/* Toggle button styles */
.toggle-btn {
    background-color: #2c2c2c;
    border: 2px solid #4CAF50;
    color: #4CAF50;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    transition-duration: 0.4s;
    cursor: pointer;
    border-radius: 20px;
    outline: none;
}

.toggle-btn:hover {
    background-color: #4CAF50;
    color: white;
}

.toggle-btn.active {
    background-color: #4CAF50;
    color: white;
}

.toggle-btn.inactive {
    background-color: #2c2c2c;
    border-color: #f44336;
    color: #f44336;
}

.toggle-btn.inactive:hover {
    background-color: #f44336;
    color: white;
}

/* Ranking input styles */
.provider-rankings {
    margin-top: 15px;
}

.provider-rankings label {
    display: block;
    margin-bottom: 8px;
    color: #ddd;
}

.provider-rankings input[type="number"] {
    width: 60px;
    padding: 8px;
    border: 1px solid #666;
    background-color: #333;
    color: #fff;
    border-radius: 3px;
    font-size: 14px;
}

/* Responsive Styles */
@media (max-width: 768px) {
    body {
        padding-top: 120px;
    }

    header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .header-content {
        width: 100%;
        justify-content: space-between;
        margin-bottom: 10px;
    }

    nav {
        position: static;
        transform: none;
        width: 100%;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 5px 0;
    }

    .header-controls {
        display: none;
    }

    .stats-display {
        flex-direction: column;
        align-items: flex-start;
    }

    .stat-item {
        margin: 5px 0;
    }

    .container {
        width: 100%;
        padding: 10px;
    }

    #itemTable td {
        padding-left: 35%;
    }

    #itemTable td:before {
        font-size: 0.8em;
    }

    .toggleDetails, 
    .deleteItem {
        font-size: 0.9em;
        padding: 6px 10px;
    }

    .provider-grid {
        grid-template-columns: 1fr;
    }

    .toggle-btn {
        width: 100%;
    }
}

/* Hamburger menu styles */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1000;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    margin: 5px 0;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
    }

    nav {
        display: none;
        width: 100%;
        position: absolute;
        top: 50px;
        left: 0;
        background-color: #1a1a1a;
        padding: 10px;
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 10px 0;
    }

    /* Hamburger animation */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}

/* Utility Classes */
.active { color: #4CAF50; }
.inactive { color: #f44336; }
.disabled-btn {
    background-color: #888;
    color: #ccc;
    cursor: not-allowed;
}