* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #eef2f5;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Nav */
header {
    background: #1c2b36;
    color: white;
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.logo-fallback {
    font-size: 24px;
    font-weight: bold;
    color: #d12a2a;
    text-decoration: none;
}

.logo-fallback span {
    color: #ffffff;
}

nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

nav a {
    color: #d1d5db;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

nav a:hover, nav a.active {
    color: #ffffff;
}

.admin-btn {
    background: #d12a2a;
    color: white !important;
    padding: 6px 14px;
    border-radius: 4px;
}

.admin-btn:hover {
    background: #b52222;
}

/* Container Layout */
.container {
    display: flex;
    max-width: 1200px;
    margin: 25px auto;
    gap: 20px;
    padding: 0 15px;
    flex: 1;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 230px;
    background: white;
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    padding: 12px;
    height: fit-content;
}

.sidebar h3 {
    font-size: 14px;
    text-transform: uppercase;
    background: #2f4050;
    color: white;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.sidebar ul {
    list-style: none;
}

.sidebar li a {
    display: block;
    padding: 8px 10px;
    color: #444;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
}

.sidebar li a:hover {
    background: #f8f9fa;
    color: #d12a2a;
    padding-left: 14px;
}

/* Content Area */
.main-content {
    flex: 1;
}

.search-box {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 20px;
    outline: none;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.search-box:focus {
    border-color: #1c2b36;
}

/* Phone Grid */
.phone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.phone-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    text-align: center;
    padding: 15px;
    transition: all 0.2s ease-in-out;
}

.phone-card:hover {
    border-color: #d12a2a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.phone-card img {
    max-width: 100%;
    height: 160px;
    object-fit: contain;
    margin-bottom: 10px;
}

.phone-card h4 {
    font-size: 14px;
    color: #1c2b36;
    margin-bottom: 8px;
    height: 38px;
    overflow: hidden;
    line-height: 1.3;
}

.price-badge {
    background: #28a745;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 3px;
    display: inline-block;
    font-weight: bold;
}

.phone-card a {
    text-decoration: none;
    color: inherit;
}

/* Details Page Specs Table */
.specs-wrapper {
    background: white;
    padding: 25px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.top-info {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    align-items: center;
}

.top-info img {
    max-width: 220px;
    height: auto;
    border: 1px solid #f0f0f0;
    padding: 10px;
}

.top-details h1 {
    font-size: 26px;
    color: #111;
    margin-bottom: 10px;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.specs-table th {
    background: #f8f9fa;
    color: #d12a2a;
    text-transform: uppercase;
    font-size: 13px;
    text-align: left;
    padding: 12px;
    border-top: 2px solid #d12a2a;
    width: 22%;
}

.specs-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.specs-table td.title {
    font-weight: bold;
    color: #555;
    width: 25%;
    background: #fcfcfc;
}

/* Admin Form Styling */
.form-card {
    background: white;
    padding: 25px;
    border-radius: 4px;
    border: 1px solid #ddd;
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.submit-btn {
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    font-weight: bold;
}

.submit-btn:hover {
    background: #218838;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* Footer */
footer {
    background: #1c2b36;
    color: #aaa;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 14px;
    border-top: 3px solid #d12a2a;
}

footer a {
    color: #fff;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
    }
    .top-info {
        flex-direction: column;
        text-align: center;
    }
}
